我在debian wheezy和标准PHP 5.3和fastcgi上使用apache2运行virtualmin
我有一个网站调用指向另一个用户主目录中的php文件的符号链接
所以/ home / user1 / public_html / adserving /符号链接到/ home / user2 / public_html /
问题是,如果我直接访问user2的php文件,它可以工作,但是如果我通过符号链接访问它,它只是吐出“没有指定输入文件”(我猜fastcgi找不到文件的路径?)
这是我的用户2的php5.fcgi:
#!/bin/bash
PHPRC=$PWD/../etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php5-cgi
这是我对该虚拟服务器的apache conf: <
VirtualHost XXXXXXXXXXX:80>
SuexecUserGroup "#1012" "#1012"
ServerName adserve.com
ServerAlias www.adserve.com
ServerAlias webmail.adserve.com
ServerAlias admin.adserve.com
DocumentRoot /home/adserve/public_html
ErrorLog /var/log/virtualmin/adserve.com_error_log
CustomLog /var/log/virtualmin/adserve.com_access_log combined
ScriptAlias /cgi-bin/ /home/adserve/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/adserve/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/adserve/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/adserve/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/adserve/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.adserve.com
RewriteRule ^(.*) https://adserve.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.adserve.com
RewriteRule ^(.*) https://adserve.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
</VirtualHost>
(域名adserve.com只是一个占位符)
关于如何解决fcgi路径解析问题的任何建议(如果这确实是问题)?
由于
答案 0 :(得分:0)
我终于能够通过放宽对我试图符号链接到的文件的整个遍历路径的权限来解决问题。它需要在整个路径上完全读取和执行访问才能按预期工作
感谢所有帮助