Categories

Our Sponsors

How-to Add in Apache modules, ie mod_rewrite

I seem to need this information often enough so I thought I would post it here for safe keeping.

In Apache 2, shared modules must be compiled with the directive:
–enable-mods-shared=’rewrite’

Multiple modules can be configured that way like so:
–enable-mods-shared=’rewrite dav dav-fs’

A simple config string would look like this:
./configure –prefix=/usr/local/apache –enable-mods-shared=’rewrite’

# EVEN if you screwed up and failed to compile it, by using the horribly broken and often incorrectly documented ‘–enable-rewrite’ switch (which DOES NOT WORK: even ./configure –help and the apache install docs includes this BS compile directive that DOES NOT WORK), ALL IS NOT LOST. You can still compile any modules by changing to the apache source dir and then the sub directories /modules/mappers (for example: /path/to/your/httpd-source/modules/mappers ) and executing the following command:

/usr/local/apache/bin/apxs -cia mod_rewrite.c

# This will compile the modules as a “so” or “shared object”, and add the proper enabling string to your httpd.conf file: LoadModule rewrite_module modules/mod_rewrite.so

The apxs method of compiling in a module should work for most of the modules you may need.  For instance mod_speling is very useful in dealing with mod_rewrite as it is used to ignore case.

I also just thought that I could download the latest XAMPP version from www.apachefriends.org and get the modules I need from there.  It may or may not work.

  • Share/Bookmark

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes