我正在尝试在 debian jessie 上设置一个具有多个虚拟主机的 apache2 服务器。我希望他们每个人都有一个不同的 FastCgiExternalServer。我在 jessie 上使用 php5-fpm 包中的 php 版本以及默认的 /etc/php5/fpm 配置文件。
基本的 apache 配置工作正常:
<VirtualHost *:80>
ServerName lalala.org
DocumentRoot "/path/to/app/www"
<Directory "/path/to/app/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Require all granted
</Directory>
FastCgiExternalServer /path/to/app/www -socket /var/run/php5-fpm.sock
AddHandler php-fcgi .php
Action php-fcgi /path/to/app/www
</VirtualHost>
但是,我在 .css、.js 文件上遇到 403 错误。我读过这篇文章:http://whocares.de/fastcgiexternalserver-demystified/8/ http://whocares.de/fastcgiexternalserver-demystified/8/,但即使使用此配置:
FastCgiExternalServer /path/to/app/www -socket /var/run/php5-fpm.sock
AddHandler php-fcgi .php
Action php-fcgi /virtualpath
Alias /virtualpath /path/to/app/fcgi-uri
(/path/to/app/fcgi-uri 是 /path/to/app/www 的符号链接)
这不起作用。就好像我遇到了本地问题,但不知道是什么。
Thanks
编辑 :
我找到了一个使 fastcgi 执行工作的解决方案:
<FilesMatch \.php$>
SetHandler "proxy:unix:/path/to/sock/socket.sock|fcgi://localhost"
</FilesMatch>
但我认为这更多的是一种解决方法而不是解决方案。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)