我正在使用Debian 7 64作为主机,并且我安装了Lighttpd和PHP-FPM以及mysql支持,在lighttpd和PHP-FPM全新安装之后,我尝试启用用户目录,并运行以下命令:
root@xxxx# lighty-enable-mod userdir
我运行上面的命令之后得到了ok的messege,但是当我运行下面的命令重新启动lighttpd时,我得到以下输出:
root@xxxx# /etc/init.d/lighttpd force-reload [FAIL] Reloading web server configuration: lighttpd failed!
我想打开/ home / user / www / project_name; 当有人打开我的网站; 像这样:www.mysite.com/project_name,所以我做了/etc/lighttpd/conf-available/10-userdir.conf
## The userdir module provides a simple way to link user-based directories into ## the global namespace of the webserver. ## # /usr/share/doc/lighttpd/userdir.txt server.modules += ( "mod_userdir" ) ## the subdirectory of a user's home dir which should be accessible ## under http://$host/~$user userdir.path = "/www/project_name/public_html" ## The users whose home directories should not be accessible userdir.exclude-user = ( "root", "postmaster" )
以下是/var/log/lighttpd/error.log文件的输出。
2013-09-29 10:25:57: (log.c.166) server started 2013-09-29 10:44:57: (server.c.1430) [note] graceful shutdown started 2013-09-29 10:44:57: (log.c.166) server started 2013-09-29 10:44:57:(mod_fastcgi.c.977) bind failed for: unix:/var/run/php5-fpm.sock-0 Permission denied 2013-09-29 10:44:57: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 2013-09-29 10:44:57: (server.c.964) Configuration of plugins failed. Going down. 2013-09-29 10:44:57: (server.c.1546) server stopped by UID = 0 PID = 5841 2013-09-29 12:59:58: (log.c.166) server started 2013-09-29 12:59:58: (mod_fastcgi.c.977) bind failed for: unix:/var/run/php5-fpm.sock-0 Permission denied 2013-09-29 12:59:58: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 2013-09-29 12:59:58: (server.c.964) Configuration of plugins failed. Going down.
我不能解决问题,寻找解决scheme。
lighttpd不能写入/var/run ,并且绑定到一个unix套接字总是创build一个新的文件(改变现有的文件权限并不会帮助你)。
/var/run不是/tmp – 只有root应该可以写入。 如果你想让lighttpd创build套接字文件,使用lighttpd拥有的目录( /tmp也是一个坏主意!)
此外,它看起来像你使用PHP-FPM:你不能从lighttpd产生PHP-FPM,删除“bin-path”选项。 php-fpm通常是通过初始化脚本(或者类似的)产生的,并且为每个用户创build一个socket,为每个用户创build一个php后端(每个用户都有自己的套接字)。