Apache2 non si avvia dopo l'eliminazione e la reinstallazione

Aug 17 2020

Sto cercando di far funzionare Jitsi Meet sulla mia LAN locale su Ubuntu Server 20.04 e ci sono riuscito ieri o due giorni fa, ma poi ho voluto provare il port forwarding. Ovviamente, dal momento che non ne so di più su quella roba e sto usando DHCP senza ulteriori limitazioni di assegnazione IP o indirizzamento statico, ho pensato di dirlo al server e cambiare le regole di port forwarding minori quando vengo riassegnato. Non sapevo come dire al server che il mio IP era cambiato, quindi ho pensato di eliminare e reinstallare Apache2 e Jitsi, ma poi Apache2 non avrebbe mai potuto avviarsi, anche se li avessi eliminati, riavviati e reinstallati. Ho cancellato un file di configurazione in /etc/apache2 che purge diceva che non avrebbe cancellato, e penso che avesse anche il mio vecchio IP lì, quindi ho pensato che sarebbe stato ricreato con il nuovo IP dopo la reinstallazione.

# 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.

Risposte

Daniel Sep 03 2020 at 09:04

Il problema era che c'erano alcuni pacchetti relativi ad apache2 che non venivano eliminati quando ho eliminato apache2, e quelli sembravano causare il problema.

L'ho risolto reinstallando dopo aver eliminato altri tre pacchetti apache2 che non vengono eliminati quando ho eliminato solo apache2.

Mi piacerebbe anche sapere perché l'ha risolto, se possibile.