I've read almost everything possible for this issue and couldn't find anything that would solve my problem. This is erorr log I'm getting: Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/vhosts/site.com/httpdocs/cgi-bin/cron.pl
When accessing site I get 403 Forbidden "You do not have permission to access this document." error.
I've modified my .htaccess to have this:
Options +FollowSymLinks +SymLinksIfOwnerMatch
AddDefaultCharset utf-8
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
.
.
.
I also added this to httpd.conf:
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
<Directory />
Options -ExecCGI FollowSymLinks -Includes -IncludesNOEXEC -Indexes -MultiViews -SymLinksIfOwnerMatch
AllowOverride All
</Directory>
Really what can I do next?
Watch that the directory where your web application is living, is not included in another parent directory which has restricted FollowSymLinks
.
The solution is to enable FollowSymLinks
at the top directory (parent directory) or move your web application to a directory outside of the scope of the "no FollowSymLinks
" in parent directory.
For example, the next apache
config could be a problem and surely it reproduces the problem:
<VirtualHost *:80>
...
<Directory "D:/">
Options Indexes
</Directory>
<Directory "D:/mywebfolder/">
Options Indexes FollowSymLinks
</Directory>
...
</VirtualHost>
To avoid this problem:
<VirtualHost *:80>
...
<Directory "D:/">
Options Indexes FollowSymLinks
</Directory>
...
...
</VirtualHost>
Or move your D:/mywebfolder/
to another unit e.g. E:/mywebfolder