When I run this command: sudo certbot --apache -d example2.com -d www.example2.com
I get the following error:
Error while running apache2ctl graceful.
httpd not running, trying to start
Action 'graceful' failed.
After having search and tested several solutions I could not found anything.
My guess is that the problem comes from certbot not understanding the config files of Apache2, because in my case it's maybe a little bit complicated, I want to use a different SSL certificate for two different sites, example1.com and example2.com.
Here is the virtualhosts in my apache2.conf
<VirtualHost *:80>
ServerName example1.com
ServerAlias www.example1.com
DocumentRoot /var/www/html
<Directory /var/www/html>
Require all granted
# Enable .htaccess overrides if required
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName example1.com
ServerAlias www.example1.com
DocumentRoot /var/www/html
<Directory /var/www/html>
Require all granted
# Enable .htaccess overrides if required
AllowOverride All
</Directory>
SSLEngine on
</VirtualHost>
<VirtualHost *:80>
ServerName example2.com
ServerAlias www.example2.com
DocumentRoot /var/www/html1
<Directory /var/www/html1>
Require all granted
# Enable .htaccess overrides if required
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName example2.com
ServerAlias www.example2.com
DocumentRoot /var/www/html1
<Directory /var/www/html1>
Require all granted
# Enable .htaccess overrides if required
AllowOverride All
</Directory>
</VirtualHost>
And I don't if this can help but I also have:
in sites-available folder:
example2.com-le-ssl.conf, example2.com.conf, default-ssl.conf, 000-default.conf
in sites-enabled folder:
example2.com-le-ssl.conf, example2.com.conf, default-ssl.conf, 000-default.conf
I am on Ubuntu 18.04 and I am using a vps
Thank you