please check your configuration it might be some misconfigured server. so first of all need to check out what error occurred
see the error and if it has occured woth your any of configuration file then remove that config file and the reboot the apache and then re isntall
The Apache config test (
apachectl configtest, or its equivalents) only tests the config file (and the files it recursively includes) for valid syntax. However, the original question asked about preventing downtime. Even when
apachectl configtest it does not return an error, an actual restart may still fail, causing downtime.
Common causes for such failures include missing or inaccessible SSL certificates, missing directories for log files, or a missing website root directory. Often, such errors are caused by removing a vhost's directory without removing the vhost Apache config file. Using a tool like a puppet or ansible is highly recommended to prevent such inconsistencies.
Seeing that this question is the number one hit when googling "apache config lint" I thought I'd mention this little detail...
sudo rm yourdomain.com-le-ssl.conf
sudo apt-get update
sudo apt-get install python-certbot-apache