2016-08-16 60 views
0

我試圖用puppet配置apache。當我嘗試啓動Apache時,出現任何錯誤消息都會失敗。我不知道它爲什麼失敗。我嘗試執行下面的命令,它只是說啓動失敗,並沒有顯示啓動失敗的具體原因。你能讓我知道如何弄清楚發生了什麼?我在下面附上我的日誌文件。apache沒有啓動,日誌上沒有正確的消息

systemctl status httpd.service 
journalctl -xe 


Aug 15 22:56:03 hostname systemd[1]: Starting The Apache HTTP Server... 
-- Subject: Unit httpd.service has begun start-up 
-- Defined-By: systemd 
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
-- 
-- Unit httpd.service has begun starting up. 
Aug 15 22:56:03 hostname httpd[18999]: no listening sockets available, shutting down 
Aug 15 22:56:03 hostname httpd[18999]: AH00015: Unable to open logs 
Aug 15 22:56:03 hostname systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE 
Aug 15 22:56:03 hostname kill[19001]: kill: cannot find process "" 
Aug 15 22:56:03 hostname audispd[414]: node=hostname type=SERVICE_START msg=audit(1471316163.292:57410): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit= 
Aug 15 22:56:03 hostname systemd[1]: httpd.service: control process exited, code=exited status=1 
Aug 15 22:56:03 hostname systemd[1]: Failed to start The Apache HTTP 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. 
Aug 15 22:56:03 hostname systemd[1]: Unit httpd.service entered failed state. 
Aug 15 22:56:03 hostname systemd[1]: httpd.service failed. 
Aug 15 22:56:03 hostname polkitd[532]: Unregistered Authentication Agent for unix-process:18984:32063862 (system bus name :1.15792, object path /org/freedesktop/P 
+0

你可以嘗試telnet到80或你在httpd上配置的端口來查看是否有其他應用程序已經在使用apache正在使用的端口? –

回答

2

我覺得你最好的提示是

Aug 15 22:56:03 hostname httpd[18999]: no listening sockets available, shutting down 

看起來像另一個過程是,Tomcat是試圖監聽套接字,默認爲8080,或者您可以檢查的conf看什麼傾聽設置

可以使用命令狀

lsof -i TCP |grep 8080 

要得到的是什麼進程id在該端口上偵聽並在top或其他任何地方追蹤它

0

我能夠找出問題,puppet的默認配置已經在httpd.conf中註釋了監聽端口並添加了一個port.conf。但是,因爲我沒有明確配置偵聽端口,所以apache沒有偵聽的默認端口。我配置了端口並開始工作。