/etc/apache2/sites-enabled# ls
000-default-le-ssl.conf salonkristina.hr.conf salonkristina.hr-le-ssl.conf
Because inside ‘salonkristina.hr.conf’ I have defined data for port 80 and inside ‘salonkristina.hr-le-ssl.conf’ I have defined data for < IfModule mod_ssl.c> port 443.
And inside ‘000-default-le-ssl.conf’ I have defined data both for port 80 and port 443.
Do you think this is a problem when it comes to renewing cert?
/etc/apache2/sites-enabled# apachectl -S
VirtualHost configuration:
*:443 is a NameVirtualHost
default server prominenthair.hr (/etc/apache2/sites-enabled/000-default-le-ssl.conf:15)
port 443 namevhost prominenthair.hr (/etc/apache2/sites-enabled/000-default-le-ssl.conf:15)
alias www.prominenthair.hr
port 443 namevhost salonkristina.hr (/etc/apache2/sites-enabled/salonkristina.hr-le-ssl.conf:2)
alias www.salonkristina.hr
*:80 is a NameVirtualHost
default server prominenthair.hr (/etc/apache2/sites-enabled/000-default-le-ssl.conf:4)
port 80 namevhost prominenthair.hr (/etc/apache2/sites-enabled/000-default-le-ssl.conf:4)
alias www.prominenthair.hr
port 80 namevhost salonkristina.hr (/etc/apache2/sites-enabled/salonkristina.hr.conf:1)
alias www.salonkristina.hr
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
I tried dry run and seems fine though:
Congratulations, all renewals succeeded. The following certs have been renewed:
/etc/letsencrypt/live/prominenthair.hr-0001/fullchain.pem (success)
/etc/letsencrypt/live/prominenthair.hr/fullchain.pem (success)
/etc/letsencrypt/live/salonkristina.hr/fullchain.pem (success)
/etc/letsencrypt/live/www.prominenthair.hr/fullchain.pem (success)
** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates above have not been saved.)
But when I try to acces from Facebook info or Instagram bio, with ‘http://www.salonkristina.hr’ it says: “The site security certificate is not trusted.”
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin mario.orlovac@gmail.com
DocumentRoot /var/www/salonkristina
ServerName salonkristina.hr
ServerAlias www.salonkristina.hr
<Directory /var/www/salonkristina/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteCond %{SERVER_NAME} =prominenthair.hr
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
SSLCertificateFile /etc/letsencrypt/live/salonkristina.hr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/salonkristina.hr/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
It would be simpler to use a single line to redirect all statement.
Like:
Here is an updated version of what you have now (delete 8 lines):
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/salonkristina
ServerName salonkristina.hr
ServerAlias www.salonkristina.hr
Redirect permanent / https://salonkristina.hr/
<Directory /var/www/salonkristina/> #DELETE THIS LINE
Options FollowSymLinks #DELETE THIS LINE
AllowOverride All #DELETE THIS LINE
Require all granted #DELETE THIS LINE
</Directory> #DELETE THIS LINE
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on #DELETE THIS LINE
RewriteCond %{SERVER_NAME} =prominenthair.hr #DELETE THIS LINE
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] #DELETE THIS LINE
</VirtualHost>
It fails to be secure because the cert at the site for the first name is from the second name - the cert name used doesn’t match the site name in the URL.
Please close and reopen your browser (may be a caching problem).
Also restart the web server.
and also show: certbot certificates