rakmohan
asked on
mod_rewrite problem - unable to restart apache web server
Hi experts,
I have apache_2.0.43 on solaris 8 machine. I tried to configure httpd.conf to set 'Authorization' http header as environment variable as following:
########################## ########## #
LoadModule rewrite_module modules/mod_rewrite.so
<Directory "/www/httpd/apache_2.0.43/ pcgi">
RewriteEngine on
RewriteCond %{HTTP:Authorization} (.*)
RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
</Directory>
########################## ########## #
I couldn't restart the Apache because it couldn't find mod_rewrite.so
Please let me know where can I find this module in apache directories. How can I check the list of modules currently loaded on the web server.
Thanks,
Rakesh.
I have apache_2.0.43 on solaris 8 machine. I tried to configure httpd.conf to set 'Authorization' http header as environment variable as following:
##########################
LoadModule rewrite_module modules/mod_rewrite.so
<Directory "/www/httpd/apache_2.0.43/
RewriteEngine on
RewriteCond %{HTTP:Authorization} (.*)
RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
</Directory>
##########################
I couldn't restart the Apache because it couldn't find mod_rewrite.so
Please let me know where can I find this module in apache directories. How can I check the list of modules currently loaded on the web server.
Thanks,
Rakesh.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should have actually 2 lines in your httpd.conf:
LoadModule rewrite_module /usr/lib/apache/mod_rewrit e.so
AddModule mod_rewrite.c
LoadModule rewrite_module /usr/lib/apache/mod_rewrit
AddModule mod_rewrite.c
httpd -l will only show you modules built statically i believe. I run apache 2.0.49 on Solaris 9, with mod_rewrite installed:
---------------
/usr/local/apache/bin#http d -l
Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_ssl.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_info.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_so.c
---------------
is what i get when I run httpd -l, now I have mod_rewrite installed, in my httpd.conf I only have:
---------------
LoadModule rewrite_module modules/mod_rewrite.so
---------------
From the documentation:
(http://httpd.apache.org/docs-2.0/programs/httpd.html)
"-l
Output a list of modules compiled into the server. This will not list dynamically loaded modules included using the LoadModule directive."
AddModule is only used if the user wants to re-order the prioritzation of his modules and is using the ClearModule feature.
By default, this is not a required option for modules on apache.
---------------
/usr/local/apache/bin#http
Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_ssl.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_info.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_so.c
---------------
is what i get when I run httpd -l, now I have mod_rewrite installed, in my httpd.conf I only have:
---------------
LoadModule rewrite_module modules/mod_rewrite.so
---------------
From the documentation:
(http://httpd.apache.org/docs-2.0/programs/httpd.html)
"-l
Output a list of modules compiled into the server. This will not list dynamically loaded modules included using the LoadModule directive."
AddModule is only used if the user wants to re-order the prioritzation of his modules and is using the ClearModule feature.
By default, this is not a required option for modules on apache.
Also, did you LOOK for the module mod_rewrite.so on your server? the physical file? yoou are running linux, you most likely ahve locate installed - do "locate mod_rewrite.so" if you dont have your locatedb done, run first updatedb as root. then execute the locate command. If you dont have locate/updatedb installed, that is ok, it is a gnu find utility for making life easier when seaching your computer.
But you should first look to see if the module is already built and installed, you just may be not using it.
But you should first look to see if the module is already built and installed, you just may be not using it.
ASKER
Hi,
I am getting 'Access denied (error code 403)' for my web pages when I compiled apache (2.0.43) as following:
########################## ##
bash-2.05$ ./configure --prefix=/usr/local/apache 2 --enable-so --enable-module=rewrite --enable-rewrite=shared
bash-2.05$ make
bash-2.05# make install
########################## ##
and added these lines in httpd.conf:
########################## ##
<Directory "/www/httpd/apache_2.0.43/ pcgi">
RewriteEngine on
RewriteCond %{HTTP:Authorization} (.*)
RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
</Directory>
########################## ##
httpd.conf has following statements after above mentioned statements:
########################## ##
<Directory "/www/httpd/apache_2.0.43/ pcgi">
AllowOverride All
Options None
Order allow,deny
Allow from all
</Directory>
########################## ##
My web pages under '/www/httpd/apache_2.0.43/ pcgi' directory works fine when I comment these statements:
########################## ##
#<Directory "/www/httpd/apache_2.0.43/ pcgi">
# RewriteEngine on
# RewriteCond %{HTTP:Authorization} (.*)
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
#</Directory>
########################## ##
Please help me to reolve this problem.
My httpd.conf already has the following statement after installation:
LoadModule rewrite_module modules/mod_rewrite.so
Thanks,
Rakesh.
I am getting 'Access denied (error code 403)' for my web pages when I compiled apache (2.0.43) as following:
##########################
bash-2.05$ ./configure --prefix=/usr/local/apache
bash-2.05$ make
bash-2.05# make install
##########################
and added these lines in httpd.conf:
##########################
<Directory "/www/httpd/apache_2.0.43/
RewriteEngine on
RewriteCond %{HTTP:Authorization} (.*)
RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
</Directory>
##########################
httpd.conf has following statements after above mentioned statements:
##########################
<Directory "/www/httpd/apache_2.0.43/
AllowOverride All
Options None
Order allow,deny
Allow from all
</Directory>
##########################
My web pages under '/www/httpd/apache_2.0.43/
##########################
#<Directory "/www/httpd/apache_2.0.43/
# RewriteEngine on
# RewriteCond %{HTTP:Authorization} (.*)
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
#</Directory>
##########################
Please help me to reolve this problem.
My httpd.conf already has the following statement after installation:
LoadModule rewrite_module modules/mod_rewrite.so
Thanks,
Rakesh.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Where should I keep rewrite statements - httpd.conf or .htaccess? Currently, it is in httpd.conf and giving 403 error.
Thanks,
Rakesh.
Thanks,
Rakesh.
.htaccess is to be used for a particular directory - you can try as well ...
Did you check the error_log ?
Did you try the rewrite_log ?
Did you try to use a different variable MY... ?
Did you check the error_log ?
Did you try the rewrite_log ?
Did you try to use a different variable MY... ?
ASKER
I tried all three suggestions. I am getting following error in error_log:
########################## #########
[Wed May 05 15:15:44 2004] [error] [client 128.107.155.203] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /www/httpd/apache_2.0.43/p cgi/btools /proto/aut h.cgi
########################## #########
rewrite.log is empty.
##########################
[Wed May 05 15:15:44 2004] [error] [client 128.107.155.203] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /www/httpd/apache_2.0.43/p
##########################
rewrite.log is empty.
ASKER
I solved the 403 error, when I added 'Options FollowSymLinks' for the required directory.
Many thanks,
Rakesh.
Many thanks,
Rakesh.
ASKER
Thanks,
Rakesh.