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

centos 7.3 64bit system
——————————————————————
Restart Lighttpd Server faild

Error message :
lighttpd.service: main process exited, code=exited, status=255/n/a

How to fix ‘lighttpd.service: main process exited, code=exited, status=255/n/a’ error ?

1.u should check the directory whether permissions is 755 (not including log files within this directory)
2.check log files within the directory /var/log/lighttpd/ whether the group and user are ‘lighttpd lighttpd’
(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!!)

If not, use the following command to repair:

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

———————————————————————————

lighttpd启动时提示:

1
2
3
4
5
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无法正常启动,解决办法如下:

首先检查目录/var/log/lighttpd的权限是否为755,组及用户是否为lighttpd lighttpd
其次,如果正确,继续检查目录下的日志文件组及用户是否为 lighttpd lighttpd

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

使用以下命令修改其为 lighttpd lighttpd

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

重启成功!记录下以免忘记

原文链接:https://xiaohost.com/2569.html,转载请注明出处。
0

评论1

请先
  1. 按照你这个做了,还是启动不了lighttpd
    lighttpderror 2022-04-27 0