SSL on CentOS 7 www not working

I have followed the tutorials for installing a Let'sEncrypt SSL certificate on my CentOS 7 using CertBot for both synergyft.com and www.synergyft.com. I chose the option to force all traffic to https. synergyft.com is working, the PHP test page is working, and the SSL certificate is correct. However www.synergyft.com is displaying the Apache test page, though it is a secure connection with the correct SSL certificate. I have followed these same steps on a different Linode using Ubuntu and had no problems. I must be missing a step here somewhere.

Here is my vhost.conf file. Note the Rewrite rule which CertBot added:

NameVirtualHost *:80

<virtualhost *:80=""> ServerAdmin mark@synergyft.com ServerName synergyft.com ServerAlias www.synergyft.com DocumentRoot /var/www/html/synergyft.com/publichtml/ ErrorLog /var/www/html/synergyft.com/logs/error.log CustomLog /var/www/html/synergyft.com/logs/access.log combined RewriteEngine on RewriteCond %{SERVERNAME} =synergyft.com [OR] RewriteCond %{SERVERNAME} =www.synergyft.com RewriteRule ^ https://%{SERVERNAME}%{REQUEST_URI} [END,NE,R=permanent] </virtualhost>

And here is my vhost-le-ssl.conf file which CertBot installed:

<ifmodule mod_ssl.c=""> <virtualhost *:443=""> ServerAdmin mark@synergyft.com ServerName synergyft.com ServerAlias www.synergyft.com DocumentRoot /var/www/html/synergyft.com/public_html/ ErrorLog /var/www/html/synergyft.com/logs/error.log CustomLog /var/www/html/synergyft.com/logs/access.log combined Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/synergyft.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/synergyft.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/synergyft.com/chain.pem </virtualhost> </ifmodule>

I have deleted my entire Linode and started over like 4 times, and I keep getting the same issue. Any ideas what I might be missing? Thanks!

Mark

2 Replies

It looks like www.synergyft.com is pointed to a different document root than synergyft.com, but both of the conf files you've provided appear to be identical. Have you restarted Apache since the SSL certificate was installed?

I'd recommend doubled checking the DocumentRoot directive by pointing it to a new location and see if it updates on restarting Apache as expected. It may be that a different configuration file is being used for www.synergyft.com than the one you intend.

Yes I did make sure to restart Apache after each change. I just discovered that ssl.conf has a document root directive that was commented out. As soon as I uncommented it and put the correct path, it started working!!! CertBot did not take care of this…

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct