清除并重新安装后 Apache2 无法启动

清除并重新安装后 Apache2 无法启动

我正在尝试让 Jitsi Meet 在 Ubuntu Server 20.04 上的本地 LAN 上运行,并且昨天或两天前成功了,但后来我想尝试端口转发。当然,由于我不太了解这些东西,并且正在使用没有额外 IP 分配限制或静态寻址的 DHCP,所以我想我只需告诉服务器并在重新分配时更改次要端口转发规则即可。我不知道如何告诉服务器我的 IP 已更改,所以我想我只需清除并重新安装 Apache2 和 Jitsi,但这样 Apache2 就永远无法启动,即使我清除它们、重新启动并重新安装。我删除了 /etc/apache2 中的一个配置文件,清除命令说它不会删除,我认为它也在那里有我的旧 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 时这些包不会被删除)并重新安装来解决这个问题。

如果可能的话,我还想知道为什么可以解决这个问题。

相关内容