我已经在一台RHEL5服务器上在PHP 5.2.10下运行nginx 0.7x + PHP-FPM,但是试图在第二台服务器上在PHP 5.3.3的捆绑式PHP-FPM下复制该设置,每次有GET时都会出现权限错误。
FPM已启动,并确认fastcgi在9000上进行侦听,但是每次执行GET时,我都会在nginx日志中看到此错误:
2010/08/12 23:38:53 [crit] 5019#0: *5 stat() "/home/noisepages/www/" failed (13: Permission denied), client: 24.215.173.141, server: dev.noisepages.com, request: "GET / HTTP/1.1", host: "dev.noisepages.com"
准系统nginx.conf.default至少可以运行。这是我的nginx.conf
server {
listen 80;
server_name dev.noisepages.com;
root /home/noisepages/www;
index index.html index.htm index.php;
access_log logs/dev.access.log;
error_log logs/dev.error.log;
location / {
if (-f $request_filename) {
expires 30d;
break;
}
# this sends all non-existing file or directory requests to index.php
rewrite ^.*/files/(.*) /wp-includes/ms-files.php?file=$1;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\.php)$ $1 last;
rewrite ^ /index.php last;
}
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/dev/shm/php-fastcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/dev/www/$fastcgi_script_name;
}
}
(额外的重写指令适用于WordPress多站点又称为WordPress MU)
我还验证了,不仅在nginx.conf中声明了用户www-data,还在php-fpm.conf中声明了用户和组值。
也许我不明白是什么原因导致了错误13消息?奇怪的是,我试图在第一台服务器上与其他两个虚拟主机并行设置dev.noisepages.com,每个虚拟主机工作正常-并出现相同的错误。