When I first installed letsecrypt I did it for exemple.com domain
now I would like to add www.exemple.com subdomain
Debian server up to date
Using putty SSH
I already tried ./letsencrypt-auto like the first time I used it but it just asks me to renew or reinstall the existing dimain exemple.com
It doesn’t allow me to add new one
I don’t know, because I don’t know what webserver you’re running. You should be able to find out yourself with the aid of a search engine such as Google.
Currently Certbot (the program that you’re using with its old name letsencrypt) doesn’t have an option to add or remove a name, although we plan to add one¹. What you have to do is request a certificate that contains all the names that you want, and then Certbot will replace the old certificate with the newly-issued one. @_az’s suggestion to use multiple -d options is right: you have to request the certificate to cover both the www and the base domain.
If you want to test with --dry-run, you can add certonly and then the test should go ahead.
¹ I mean, you can add and remove names by giving a different list of names that the certificate should cover, but there is no option dedicated to performing this specific task, without also requiring you to list all of the names that you want in the cert.
thankf for the reply so if I understand:
under letsencypt folder i run the command
./certbot-auto -d exemple.com -d www.exemple.com --dry-run
?
if test is ok i do it again without --dry-run and I am done ?
It seems you don’t have a virtual host set up for your www subdomain, so Apache will just use the default one. Looks like that’s wordpress.conf for HTTP since the others are HTTPS. However, you might be better off to cancel and set up a virtual host first. Either a simple one that’s just something like
A text file. The location will depend on your operating system. For example on Debian/Ubuntu/etc the files are in /etc/apache2/sites-available/ - you can try finding and editing the existing wordpress.conf, find a line that looks like ServerName example.com
and add a new line after it: ServerAlias www.example.com
Or you can add a new file with the four lines I posted above, and enable it with a command like sudo a2ensite newfilename
If you have a different operating system the files may be in a different place. Try locate wordpress-le-ssl.conf to find them.