I have a self hosted CentOS 7 server with apache and wordpress.
Everything works and it’s set up to work without www so http://mydomain.com
On my dns i set up a CNAME just to be sure so www.mydomain.com redirect to mydomain.com
today i ran (WRONG because of www)
./letsencrypt-auto --apache -d www.mydomain.com
and select “2” to automatic redirect all traffic to https
and i start receive SSL_ERROR_BAD_CERT_DOMAIN trying to visit my website
when i noticed the mistake i run again the correct command
./letsencrypt-auto --apache -d mydomain.com
without www and tried to revoke and delete the first certificate with the www
(DO NOT WORK means I receive certificate error, with a “continue anyway” i can see website)
Best way to solve this? I don’t wanna destroy server with a wrong command and I’m not an expert so please explain me a bit how to move and where to check
Many thanks
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running apachectl configtest.
AH00526: Syntax error on line 15 of /etc/httpd/conf.d/old_mywebsite-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/www.mywebsite.com/cert.pem' does not exist or is empty
The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError("Error while running apachectl configtest.\n\nAH00526: Syntax error on line 15 of /etc/httpd/conf.d/old_mywebsite-le-ssl.conf:\nSSLCertificateFile: file '/etc/letsencrypt/live/www.mywebsite.com/cert.pem' does not exist or is empty\n",)
line 15 of /etc/httpd/conf.d/old_mywebsite-le-ssl.conf still point to a directory that doesn't exist anymore...
If you delete the files ending with le-ssl.conf in /etc/httpd/conf.d/ (backing up the existing files is always a good idea!), you should be able to start "fresh".
i moved the le-ssl.conf and mydomain.conf in another folder, recreate a new conf file for virtual host with port 80 and execute the command. It worked flawless.