我看过很多关于这个问题的帖子,但问题没有解决。
我试图httpd.service
通过这个命令开始:
$ sudo systemctl start httpd.service
错误 :
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
附:
$ journalctl -xn
上述命令的输出是:
-- Logs begin at Sat 2014-03-29 22:42:48 IRDT, end at Sat 2014-05-10 23:58:05 IRDT. --
May 10 23:55:51 localhost systemd[1]: Unit httpd.service entered failed state.
May 10 23:55:51 localhost sudo[18583]: pam_unix(sudo:session): session closed for user root
May 10 23:58:05 localhost sudo[19575]: kamix : TTY=pts/1 ; PWD=/home/kamix ; USER=root ; COM
May 10 23:58:05 localhost sudo[19575]: pam_unix(sudo:session): session opened for user root
May 10 23:58:05 localhost systemd[1]: Starting Apache Web Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
May 10 23:58:05 localhost apachectl[19578]: httpd: Syntax error on line 59 of /etc/httpd/con
May 10 23:58:05 localhost sudo[19575]: pam_unix(sudo:session): session closed for user root
May 10 23:58:05 localhost systemd[1]: httpd.service: control process exited, code=exited sta
May 10 23:58:05 localhost systemd[1]: Failed to start Apache Web Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
答案1
根据apachectl configtest
我的 Arch linux 服务器文件的输出,以及一点谷歌搜索,看来有问题当你将 Apache 从 2.2 升级到 2.4。我依稀记得去年的某个时候也遇到过这个问题。我建议保存httpd.conf
在某个地方,执行pacman -R apache
,然后pacman -S apache
。使用一些差异工具将 Apache 2.4/etc/httpd/conf/httpd.conf
与您保存的版本进行比较,并对新的httpd.conf
.可能只会有一些必要的改变。我个人删除了一些我不需要的命名虚拟服务器。