Forum Moderators: phranque
I'm experiencing one problem with Apache2 on Linux. If
I insert a "RewriteEngine On" line in ".htaccess", webpages
return a "403 Forbidden Error".
I inserted these lines in 'httpd.conf':
------------
<Directory "/var/www/httpdocs">
Options Indexes FollowSymLinks
AllowOverride All
FCGIWrapper /var/www/httpdocs/bin/php5 .php5
FCGIWrapper /var/www/httpdocs/bin/php5 .php
Options ExecCGI
Allow from all
Order Allow,Deny
</Directory>
--------------
If I create a 'http://www.mydomain.com/phpinfo.php', there's no info about 'mod_rewrite'.
But if I open '/etc/httpd/conf/httpd.conf', I see:
-----
LoadModule rewrite_module modules/mod_rewrite.so
----
And if I list compiled modules:
--------------
[]# httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
--------------------
Anyhow, if you have only the mentioned LoadModule, and no additional mod_rewrite directives, then turning on rewriting should not give you such a http status code, unless there are directives which makes mod_rewrite and Apache respond in such a manner (RewriteRule with the [F] flag for example).
Please note that placing an executable file (php5) into a directory which is visible to the world, is not a good idea, it is recommended to avoid this due to security issues.
Unless someone else have a better idea (or the directives below didn't solve your problem), post the relevant part of your httpd.conf or .htaccess file, perhaps you are just looking to the wrong place.
By the way, your directory definition can be simplified (and improved) to:
<Directory /var/www/httpdocs>
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
FCGIWrapper /var/www/httpdocs/bin/php5 .php5
FCGIWrapper /var/www/httpdocs/bin/php5 .php
# Maybe this line will solve your problem anyway
Allow from all
Order Allow,Deny
</Directory>