清除並重新安裝後 Apache2 無法啟動

清除並重新安裝後 Apache2 無法啟動

我試圖讓 Jitsi Meet 在 Ubuntu Server 20.04 上的本地 LAN 上運行,昨天或兩天前成功了,但後來我想嘗試連接埠轉送。當然,由於我對這些東西了解不多,並且正在使用 DHCP,沒有額外的 IP 分配限製或靜態尋址,所以我想我只需告訴伺服器並在重新分配時更改次要連接埠轉送規則。不知道如何告訴伺服器我的 IP 發生了變化,所以我想我只需清除並重新安裝 Apache2 和 Jitsi,但是 Apache2 永遠無法啟動,即使我清除它們、重新啟動並重新安裝也是如此。我刪除了 /etc/apache2 中的一個配置文件,purge 說它不會刪除,而且我認為它也有我的舊 IP,所以我認為它會在重新安裝時用新 IP 重新創建。

# apt install apache2

...

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2020-08-16 18:01:37 UTC; 32ms ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 1948 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Aug 16 18:01:37 danserve apachectl[1958]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Aug 16 18:01:37 danserve apachectl[1958]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Aug 16 18:01:37 danserve apachectl[1958]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Aug 16 18:01:37 danserve apachectl[1958]: no listening sockets available, shutting down
Aug 16 18:01:37 danserve apachectl[1958]: AH00015: Unable to open logs
Aug 16 18:01:37 danserve apachectl[1948]: Action 'start' failed.
Aug 16 18:01:37 danserve apachectl[1948]: The Apache error log may have more information.
Aug 16 18:01:37 danserve systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Aug 16 18:01:37 danserve systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 16 18:01:37 danserve systemd[1]: Failed to start The Apache HTTP Server.

答案1

問題是,當我清除 apache2 時,有一些與 apache2 相關的軟體包沒有被清除,而這些軟體包似乎是導致問題的原因。

我透過清除其他三個 apache2 軟體包後重新安裝解決了這個問題,當我只清除 apache2 時,這些軟體包不會被刪除。

如果可能的話,我也想知道為什麼會解決這個問題。

相關內容