Apache2 無法在 Arch Linux 中啟動

Apache2 無法在 Arch Linux 中啟動

我看過很多關於這個問題的帖子,但問題沒有解決。

我試著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.可能只會有一些必要的改變。我個人刪除了一些我不需要的命名虛擬伺服器。

相關內容