问题描述
我已经阅读了有关此问题的几乎所有可能的内容,但找不到任何可以解决我的问题的内容.这是我收到的错误日志:选项 FollowSymLinks 或 SymLinksIfOwnerMatch 关闭,这意味着禁止 RewriteRule 指令:/var/www/vhosts/site.com/httpdocs/cgi-bin/cron.pl
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
访问站点时,我收到 403 Forbidden 您无权访问此文档."错误.
When accessing site I get 403 Forbidden "You do not have permission to access this document." error.
我已经修改了我的 .htaccess 以获得这个:
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]
.
.
.
我也在 httpd.conf 中添加了这个:
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>
接下来我该怎么办?
推荐答案
注意您的 Web 应用程序所在的目录不包含在另一个限制 FollowSymLinks
的父目录中.
Watch that the directory where your web application is living, is not included in another parent directory which has restricted FollowSymLinks
.
解决方案是在顶级目录(父目录)启用 FollowSymLinks
或将您的 Web 应用程序移动到no 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.
例如,下一个 apache
配置可能是一个问题,它肯定会重现该问题:
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>
为了避免这个问题:
<VirtualHost *:80>
...
<Directory "D:/">
Options Indexes FollowSymLinks
</Directory>
...
...
</VirtualHost>
或者将您的 D:/mywebfolder/
移动到另一个单元,例如E:/mywebfolder
Or move your D:/mywebfolder/
to another unit e.g. E:/mywebfolder
这篇关于选项 FollowSymLinks 或 SymLinksIfOwnerMatch 已关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!