close

案發時間: 2017-08

現場(環境):CentOS 7

被害人(套件名稱): Apache

 

筆錄(錯誤原因):

(98)Address already in use: AH00072: make_sock: could not bind...:443

 

詳細狀況(錯誤訊息):

[root@demo ~]# systemctl status httpd.service

● httpd.service - The Apache HTTP Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)

Active: failed (Result: exit-code) since Thu 2017-08-03 18:11:32 CST; 14s ago

Docs: man:httpd(8)

man:apachectl(8)

Process: 11612 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)

Process: 11610 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)

Main PID: 11610 (code=exited, status=1/FAILURE)

 

Aug 03 18:11:32 systemd[1]: Starting The Apache HTTP Server...

Aug 03 18:11:32  httpd[11610]: (98)Address already in use: AH00072: make_sock: could not bind...:443

Aug 03 18:11:32  systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE

Aug 03 18:11:32  kill[11612]: kill: cannot find process ""

Aug 03 18:11:32 systemd[1]: httpd.service: control process exited, code=exited status=1

Aug 03 18:11:32  systemd[1]: Failed to start The Apache HTTP Server.

 

事件處理過程:

原以為是服務已經被其他服務佔用,導致apache服務無法正常啟動。

 

鑑識1:

透過下方指令去檢查是否443 已經被人搶走!!!

#
ss -tnlp | grep 443


鑑識2結果:
沒有任何服務已經先將
443佔用掉



鑑識2:

朝向查詢
httpd設定檔當中,有沒有重複Listen的服務。


(範例):
# grep -ir "^listen" /etc/httpd/*


鑑識2結果 :

[root@demo ~]# grep -ir "^listen" /etc/httpd/*

/etc/httpd/conf/httpd.conf:Listen 80

/etc/httpd/conf.d/ssl.conf:Listen 443 https

/etc/httpd/conf.modules.d/00-ssl.conf:Listen 443

 

預設一般啟用https服務的,都會只有下列兩個檔案內有( 除非是要另外設定)

[root@demo ~]# grep -ir "^listen" /etc/httpd/*

/etc/httpd/conf/httpd.conf:Listen 80

/etc/httpd/conf.modules.d/00-ssl.conf:Listen 443

 

方向 :
兩邊設定檔再服務啟用時互相搶奪443 產生衝突。



解決方法:

目前先將下列的設定檔,檔案先更名

/etc/httpd/conf.d/ssl.conf:Listen 443 https

改成

/etc/httpd/conf.d/ssl.conf_bak

 

因為預設是讀取*.conf檔案,把這編修改掉就不會造成會讀取到兩個Listen 443的檔案。

服務就正常了

 

(案件結案)

arrow
arrow
    全站熱搜

    IT001 發表在 痞客邦 留言(0) 人氣()