If the configuration changes that broke apache were made by certbot, you can use the certbot rollback
(or ./certbot-auto rollback
) command to revert those changes. Removing the httpd package will not delete the configuration in /etc/httpd
AFAIK, so it would make sense that this does not fix your problem.
If the rollback command doesn’t get you anywhere, please provide the error message you get when apache fails to start, and we can try to fix the errors manually. You should be able to see that message either when you’re restarting apache, in your apache error log or in your system log.
Once apache is working again, prepare the configuration for certbot:
Certbot works best if your <VirtualHost>
definitions are in a separate file, with one <VirtualHost>
tag per file. I would recommend moving all your <VirtualHost>
directives to separate files in /etc/httpd/conf.d
. For example, if you have two separate vhosts, one for example.com
and one for foo.example.com
, you might have /etc/httpd/conf.d/example.com.conf
and /etc/httpd/conf.d/foo.example.com.conf
. The CentOS documentation on the certbot homepage should be sufficient once your configuration is prepared in this way. Certbot will then create two additional files with SSL vhosts for you.