Lighttpd не запускается после перезагрузки

2222
Mark

Я установил lightpd на Raspberry Pi (с Raspbian Stretch) следующим образом:

apt-get install -y lighttpd php-common php-cgi php lighty-enable-mod fastcgi-php usermod -aG www-data pi 

после запуска сервиса я проверил, и он работал нормально, обслуживая веб-страницы php, как и ожидалось. После перезагрузки сервис больше не запускается:

$ systemctl status lighttpd.service ● lighttpd.service - Lighttpd Daemon Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2017-09-09 21:26:39 CEST; 6min ago Process: 1302 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255) Process: 1295 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS) Main PID: 1302 (code=exited, status=255)  Sep 09 21:26:38 rpi systemd[1]: lighttpd.service: Failed with result 'exit-code'. Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Service hold-off time over, scheduling restart. Sep 09 21:26:39 rpi systemd[1]: Stopped Lighttpd Daemon. Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Start request repeated too quickly. Sep 09 21:26:39 rpi systemd[1]: Failed to start Lighttpd Daemon. Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Unit entered failed state. Sep 09 21:26:39 rpi systemd[1]: lighttpd.service: Failed with result 'exit-code'. 

Вот файл конфигурации:

$ cat /etc/lighttpd/lighttpd.conf  server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", )  server.document-root = "/home/pi/www" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" server.port = 80   index-file.names = ( "index.php", "index.html", "index.lighttpd.html" ) url.access-deny = ( "~", ".inc" ) static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )  compress.cache-dir = "/var/cache/lighttpd/compress/" compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )  # default listening port for IPv6 falls back to the IPv4 port include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 

Что я должен проверить?

0

1 ответ на вопрос

0
Mark

Вы должны проверить, что если какой-либо каталог, который он собирается использовать, не подключен к системе tmpfs. Lighttpd не может воссоздать их после установки.

Решение состоит в том, чтобы вручную создавать при каждой перезагрузке следующие каталоги:

  • /var/log/litghtpd
  • /var/run/lighttpd

владеть ими как www-data.

Похожие вопросы