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 and I chose the option to force all traffic to https. is working, the PHP test page is working, and the SSL certificate is correct. However 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 ServerName ServerAlias DocumentRoot /var/www/html/ ErrorLog /var/www/html/ CustomLog /var/www/html/ combined RewriteEngine on RewriteCond %{SERVERNAME} [OR] RewriteCond %{SERVERNAME} 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 ServerName ServerAlias DocumentRoot /var/www/html/ ErrorLog /var/www/html/ CustomLog /var/www/html/ combined Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/ SSLCertificateKeyFile /etc/letsencrypt/live/ SSLCertificateChainFile /etc/letsencrypt/live/ </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!


2 Replies

It looks like is pointed to a different document root than, 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 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…


Please enter an answer

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] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct