I have Apache/2.4.41 installed on Ubuntu 20.04 LTS. This is on a cloud VM.
The server has PHP 7.4, and PHP 7.3 installed. Phyton was deleted completely by mistake and then installed back. Then, I tried to recover as many libraries as possible. Not sure if there are still some missing.
I installed an SSL certificate from let'sencrypt. Since the installation, I've been having trouble accessing the site. Sometimes the browser says the site is unreachable. To fix it, I have to ssh the server and restart apache by using sudo service apache2 restart
. After that, the site becomes reachable again.
sudo apache2ctl configtest
Syntax OK
What can be wrong with it? I don't want to lose my configutation files in case I have to reinstall apache2. It seems that I have to restart apache2 every day.
After trying solution from @Matigo, cleared error.log, and restarted apache2:
cat /var/log/apache2/error.log
[Sun Mar 07 22:38:42.177067 2021] [mpm_prefork:notice] [pid 1566] AH00169: caught SIGTERM, shutting down
[Sun Mar 07 22:38:42.264574 2021] [mpm_prefork:notice] [pid 9359] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1j configured -- resuming normal operations
[Sun Mar 07 22:38:42.264636 2021] [core:notice] [pid 9359] AH00094: Command line: '/usr/sbin/apache2'
sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-03-08 23:25:02 UTC; 14h ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 9348 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 9359 (code=exited, status=1/FAILURE)
Mar 07 22:38:42 bhub systemd[1]: Starting The Apache HTTP Server...
Mar 07 22:38:42 bhub systemd[1]: Started The Apache HTTP Server.
Mar 08 23:25:02 bhub systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Mar 08 23:25:02 bhub systemd[1]: apache2.service: Failed with result 'exit-code'.