mod_rewrite not loading despite being in sysconfig/apache2

Oh, the strange things mod_rewrite does!

mod_rewrite not loading despite being in sysconfig/apache2

Postby BrianH » Wed Apr 15, 2009 12:56 pm

Hi there,

Can anyone help me determine why mod_rewrite is not being loaded. I've tried the FAQs and dozens of threads on various sites, but to no avail.

I'm running SuSE Linux 10.0, with Apache 2.0.54, on a virtual server with several domains.

I have included 'rewrite' in etc/sysconfig/apache2:

Code: Select all
APACHE_MODULES="access actions alias auth autoindex cgi dir include log_config mime negotiation rewrite setenvif status userdir asis imap perl python php4 php5"


However, the rewrite module does not then appear in etc/apache2/sysconfig.d/loadmodule.conf:

Code: Select all
#
# Files in this directory are created at apache start time by /usr/sbin/rcapache2.
# Do not edit them!
#

# as listed in APACHE_MODULES (/etc/sysconfig/apache2)

LoadModule perl_module                    /usr/lib/apache2/mod_perl.so
LoadModule access_module                  /usr/lib/apache2-prefork/mod_access.so
LoadModule actions_module                 /usr/lib/apache2-prefork/mod_actions.so
LoadModule alias_module                   /usr/lib/apache2-prefork/mod_alias.so
LoadModule auth_module                    /usr/lib/apache2-prefork/mod_auth.so
LoadModule auth_dbm_module                /usr/lib/apache2-prefork/mod_auth_dbm.so
LoadModule autoindex_module               /usr/lib/apache2-prefork/mod_autoindex.so
LoadModule cgi_module                     /usr/lib/apache2-prefork/mod_cgi.so
LoadModule dir_module                     /usr/lib/apache2-prefork/mod_dir.so
LoadModule env_module                     /usr/lib/apache2-prefork/mod_env.so
LoadModule expires_module                 /usr/lib/apache2-prefork/mod_expires.so
LoadModule include_module                 /usr/lib/apache2-prefork/mod_include.so
LoadModule log_config_module              /usr/lib/apache2-prefork/mod_log_config.so
LoadModule mime_module                    /usr/lib/apache2-prefork/mod_mime.so
LoadModule negotiation_module             /usr/lib/apache2-prefork/mod_negotiation.so
LoadModule setenvif_module                /usr/lib/apache2-prefork/mod_setenvif.so
LoadModule ssl_module                     /usr/lib/apache2-prefork/mod_ssl.so
LoadModule userdir_module                 /usr/lib/apache2-prefork/mod_userdir.so
LoadModule php5_module                    /usr/lib/apache2/libphp5.so
LoadModule python_module                  /usr/lib/apache2/mod_python.so
LoadModule suexec_module                  /usr/lib/apache2-prefork/mod_suexec.so


As a result any use of RewriteEngine causes an error:

"Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration"


mod_rewrite does seem to be included however, as the following file exists:
/usr/lib/apache2-prefork/mod_rewrite.so

Any thoughts?

Brian
BrianH
 
Posts: 2
Joined: Wed Apr 15, 2009 11:40 am

Postby richardk » Wed Apr 15, 2009 1:48 pm

I have included 'rewrite' in etc/sysconfig/apache2:
Code: Select all
APACHE_MODULES="access actions alias auth autoindex cgi dir include log_config mime negotiation rewrite setenvif status userdir asis imap perl python php4 php5"

I've never used this. Is that all you need to do?

You could try adding
Code: Select all
LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so

to your httpd.conf file to see if it causes an error.

You could also try deleting /etc/apache2/sysconfig.d/loadmodule.conf then restarting Apache in case it is a permission error that the file cannot be overwritten.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby BrianH » Fri Apr 17, 2009 11:12 am

Many thanks Richard - that seems to have done the trick!

I hadn't done that before because I thought I either had to use the apache2 file OR this method, having never found a thread with a solution containing both.
BrianH
 
Posts: 2
Joined: Wed Apr 15, 2009 11:40 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 14 guests

cron