skip to Main Content

In my apache error logs, I have bunch of ssl warnings saving You configured HTTPS(443) on the standard HTTP(80) port!

Here is my site.ca.conf file

<VirtualHost *:80>
  ServerName site.ca:80
  DocumentRoot "/var/www/site/public"
  <Directory "/var/www/site/public">
    AllowOverride all
  </Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =site.ca
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

and here is my site.ca-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerName site.ca:80
  DocumentRoot "/var/www/site/public"
  <Directory "/var/www/site/public">
    AllowOverride all
  </Directory>
ServerAlias site.ca
SSLCertificateFile /etc/letsencrypt/live/site.ca/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/site.ca/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Every thing works fine. I am not sure why this warning shows up every day in my apache log files, and how can I resolve it?

2

Answers


  1. Generally, this is because you do not have any SSL configuration on the virtual host on port 443. You may need to enable “SSLEngine on” and provide certificate information. The warning indicates are serving regular HTTP traffic on what is usually an HTTPS port.

    Login or Signup to reply.
  2. In these config files listed by the requester, there are some tweaks/corrections to be done:

    • we don’t need to have a DocumentRoot in the site.ca.conf because we will redirect HTTP to the HTTPS (site.ca-le-ssl.conf)
    • the ServerName directive shouldn’t have a port number, instead it should be in the VirtualHost level
    • the ServerName and ServerAlias should be near to each other and there should be http://www.site.ca as an Alias too in both files to handle the requests containing the www
    • in site.ca-le-ssl.conf file there is a ServerName site.ca:80 and that’s not correct (there should be no port number)
    • there must be a SSLEngine on in the site.ca-le-ssl.conf

    I hope that help someone even this is an old question

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search