lighttpd启动失败,提示lighttpd.service: main process exited, code=exited, status=255/n/a的解决方法

来自:互联网
时间:2018-09-23
阅读:

centos 7.3 64bit systemF33免费资源网

------------------------------------------------------------------F33免费资源网

Restart Lighttpd Server faildF33免费资源网

Error message :F33免费资源网

lighttpd.service: main process exited, code=exited, status=255/n/aF33免费资源网

How to fix 'lighttpd.service: main process exited, code=exited, status=255/n/a' error ?F33免费资源网

1.u should check the directory whether permissions is 755 (not including log files within this directory)F33免费资源网

2.check log files within the directory /var/log/lighttpd/ whether the group and user are 'lighttpd lighttpd'F33免费资源网

(Pay attention to using the commend above......if u use different groups and users to compile Lighttpd code, u should use your Lighttpd's own group and user!!)F33免费资源网

If not, use the following command to repair:F33免费资源网

chown lighttpd:lighttpd /var/log/lighttpd/access.logF33免费资源网

chown lighttpd:lighttpd /var/log/lighttpd/error.logF33免费资源网

---------------------------------------------------------------------------------F33免费资源网

lighttpd启动时提示:F33免费资源网

Started Lightning Fast Webserver With Light System Requirements.
Starting Lightning Fast Webserver With Light System Requirements...
lighttpd.service: main process exited, code=exited, status=255/n/a
Unit lighttpd.service entered failed state.
lighttpd.service failed.

分析原因:由于日志文件不可写,造成lighttpd无法正常启动,解决办法如下:F33免费资源网

首先检查目录/var/log/lighttpd的权限是否为755,组及用户是否为lighttpd lighttpdF33免费资源网

其次,如果正确,继续检查目录下的日志文件组及用户是否为 lighttpd lighttpdF33免费资源网

最后,排查到日志access.log和error.log的用户及组为root root 导致lighttpd无法写入日志文件F33免费资源网

使用以下命令修改其为 lighttpd lighttpdF33免费资源网

chown lighttpd:lighttpd /var/log/lighttpd/access.log
chown lighttpd:lighttpd /var/log/lighttpd/error.log

重启成功!F33免费资源网

返回顶部
顶部