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

  • A+
所属分类:Lighttpd

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:

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

---------------------------------------------------------------------------------

lighttpd启动时提示:

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

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

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

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: