Forum Moderators: phranque
I started having issues right away. For some reason .htaccess files don't work well. Right when I declare RewriteEngine on it gives me 403 error.
I've tried puting the code into a config file directly. Rewrite engine seems to work, but does not rewrite anything. The code used to work on the old server no problem for past year.
Did anyone experience the same problems?
Server has Apache 2, Plesk 7 cp, and SuExec installed.
Main httpd.conf file:
<Directory />
Options All
AllowOverride All
</Directory
Local to the account httpd.include file:
<VirtualHost 12.34.56.789:80>
ServerName widgets.com:80
ServerAlias www.widgets.com
UseCanonicalName Off
SuexecUserGroup username psacln
ServerAdmin "webmaster@widgets.com"
DocumentRoot /home/httpd/vhosts/widgets.com/httpdocs
CustomLog /home/httpd/vhosts/widgets.com/statistics/logs/access_log combined
ErrorLog /home/httpd/vhosts/widgets.com/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /home/httpd/vhosts/widgets.com/web_users
</IfModule>
ScriptAlias /cgi-bin/ /home/httpd/vhosts/widgets.com/cgi-bin/
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /home/httpd/vhosts/widgets.com/httpdocs>
<IfModule mod_perl.c>
<Files ~ (\.pl)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "/home/httpd/vhosts/widgets.com/httpdocs:/tmp"
</IfModule>
Options +Includes +ExecCGI
</Directory>
Alias "/error_docs" "/home/httpd/vhosts/widgets.com/error_docs"
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
</VirtualHost>
If any, even the most simple mod_rewrite rule is ran, I get an error in the browser:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
Log says:
Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden:
I suspect it to be the SuExec messing things up, but have no idea what to do to fix it.
I've tried both methods: using .htaccess file and putting the code directly into vhost.conf file - no luck.
If you haven't enabled mod_rewrite, you'll get an message like this in your error log when you just have
RewriteEngine on in your .htaccess: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration
Unfortunately, I get a 500 error, not a 403 like you do.
So I don't really know how to help you with your problem.
The way I see it now: SuEXEC blocks any sort of links withing the system. And when you rewrite it to a not existing file, it thinks it's a link and refuses it. That is just imo...