因权限造成lighttpd无法启动

最近不知道为什么lighttpd又跑不动了(当然不是VPS上的,而是路由上的) ,运行

lighttpd -f /etc/lighttpd/lighttpd.conf -D

得到了下面这堆奇怪的结果

2012-3-20 13:55:54: (log.c.172) server started
2012-3-20 13:55:54: (mod_fastcgi.c.1087) the fastcgi-backend /usr/bin/php-fcgi failed to start:
2012-3-20 13:55:54: (mod_fastcgi.c.1091) child exited with status 13 /usr/bin/php-fcgi
2012-3-20 13:55:54: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2012-3-20 13:55:54: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2012-3-20 13:55:54: (server.c.928) Configuration of plugins failed. Going down.

接着就无法启动了……

我擦勒,不带这样玩的啊喂,这种莫名其妙的东西是什么啊,到底是什么问题你说一下啊。不得已,只得在网上不断的搜索,都没有相关的资料……最后从某个英文的网站找到了一个指引(明灯啊!)strace

大概是一个调试的东东,在opkg的info里面的介绍是“A useful diagnostic, instructional, and debugging tool. Allows you to track whatsystem calls a program makes while it is running.”

接着我根据那位大神所说的,运行了一次

strace -ff lighttpd -D -f /etc/lighttpd/lighttpd.conf

结果出来了一大串一大串文字,刷屏了,而且看不到头。不过看到了一个很重要的信息

运行/usr/bin/php-fcgi的时候出现了“permission denied”。嗯?有问题?权限的话是755,应该没问题啊,尝试直接用root来运行lighttpd,报告说不能用root来运行。于是又新建了一个www-data的用户来运行,在用su切换账户的时候发现问题了。这个问题之前也提到过,于是就顺手改了过来。接着切换过去一运行/usr/bin/php-fcgi,没问题了。再运行lighttpd,也没问题了……

这可真蛋疼啊,明明之前的版本都可以直接用其他用户来运行的,现在的话还有自己动手。

发表评论