Hello to all,
I've come to see you because I've just changed my certificate. Indeed, I had a classic self-signed certificate with let's encrypt, but I have 2 sub-domains and after some research I found that I had to generate a wildcard certificate and not a lambda certificate.
I managed to generate via the API of ovh (because I am with them) the precious sesame, and I find myself with :
_ My main domain aseaction.fr which works correctly.
_ My subdomain www.aseaction.fr which also works with a certificate.
But I have a last sub-domain cooperations.aseaction.fr which doesn't want to go to https, and I don't understand why, here is the corresponding vhost file, I have regenerated a certificate especially for this domain with the command :
certbot certonly --dns-ovh --dns-ovh-credentials ovh.txt -d cooperations.aseaction.fr
The command works and the certificate is correctly generated, unfortunately, when I indicate the right path in the vhost and I restart apache I see that I am still not in https.
I have at one time succeeded (I do not even know how) to pass it in "semi secure" I mean that the domain was not automatically redirected in https but when manually we put the s the certificate was present. This is not even the case anymore.
I don't really understand, if my subdomain www.aseaction.fr works correctly it's because the certificate supports subdomains, so why nothing happens with cooperations.aseaction.fr ...
By activating certbot without any command it returns us this :
Which names would you like to activate HTTPS for?
1: aseaction.com
2: www.aseaction.fr
We can see that it does not detect cooperations.aseaction.fr which is also strange ...
My vhost file of cooperations.aseaction.fr
<IfModule mod_ssl.c>
<VirtualHost *:443>
#ServerAlias aseaction.cooperations.fr
ServerAdmin contact@aseaction.fr
ServerName cooperations.aseaction.fr
DocumentRoot /var/www/aseaction/
#ServerAlias aseaction.cooperations.fr
<Directory /var/www/aseaction/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteEngine on
SSLCertificateFile /etc/letsencrypt/live/cooperations.aseaction.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cooperations.aseaction.fr/privkey.pem
RewriteCond %{SERVER_NAME} = cooperations.aseaction.fr
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
For the configuration I use a version of certbot in 1.24 as well as apache as web server and a debian 10 (version5.10)
Thank you in advance to all, and if you wish additional information I am at your disposal.
Sincerely,