Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
root@rick-hp:/home/rick# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2018-09-27 09:48:24 +08; 22s ago
Process: 16911 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
Process: 15588 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Process: 17418 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 15510 (code=exited, status=0/SUCCESS)
Sep 27 09:48:23 rick-hp systemd[1]: Starting The Apache HTTP Server...
Sep 27 09:48:24 rick-hp apachectl[17418]: AH00526: Syntax error on line 3 of /etc/apache2/mods-enabled/dir.conf:
Sep 27 09:48:24 rick-hp apachectl[17418]: Invalid command 'index.xhtml', perhaps misspelled or defined by a modu
Sep 27 09:48:24 rick-hp apachectl[17418]: Action 'start' failed.
Sep 27 09:48:24 rick-hp apachectl[17418]: The Apache error log may have more information.
Sep 27 09:48:24 rick-hp systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 27 09:48:24 rick-hp systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 27 09:48:24 rick-hp systemd[1]: Failed to start The Apache HTTP Server.
Can you help? It started once then after trying to config for wordpress I get this.
答案1
通过查看输出可以更好地理解该问题/var/log/apache2/error.log
- 但是您发布的输出显示:
AH00526: Syntax error on line 3 of /etc/apache2/mods-enabled/dir.conf:
Invalid command 'index.xhtml', perhaps misspelled or defined by a modu
您可能遗漏了部分配置,例如:
DirectoryIndex index.xhtml