I installed WordPress and let’s encrypt following the quick start guide, however, immediately after setting it up fully the website stops loading.

Let’s Encrypt was set to redirect to https, and there were no errors on the configuration.

Checked https://check-your-website.server-daten.de/?q=todologistics.com and got this:

Wrong redirect one domain http to other domain https. First redirect to https without new dns query, so the server can send the HSTS header. That's fundamental using HSTS (Http Strict Transport Security). First step: Add correct redirects http ⇒ https. Perhaps in your port 80 vHost something like "RewriteEngine on" + "RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]" (two rows, without the "). Don't add this in your port 443 vHost, that would create a loop. Then recheck your domain, should be Grade C. There is the rule to select one https version as preferred version.

However, apache 2 configs look fine:

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost

        ServerName todologistics.com
        ServerAlias www.todologistics.com

        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.todologistics.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.todologistics.com/privkey.pem
</VirtualHost>
</IfModule>
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        ServerName todologistics.com
        ServerAlias www.todologistics.com

        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.todologistics.com [OR]
RewriteCond %{SERVER_NAME} =todologistics.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi @evargasw,

Everything seems correct in your VirtualHost file, however it’s possible you haven’t allowed connections on port 443.

If you are using UFW, you can list all application profiles available on your server by typing:

sudo ufw app list

Depending on the packages installed on your system the output will look similar to the following:

Available applications:
  Apache Full
  Apache HTTP
  Apache HTTPS
  OpenSSH
  Postfix
  Postfix SMTPS
  Postfix Submission

HTTPS connections can be allowed with the following command:

sudo ufw allow https

To achieve the same instead of https profile you can use the port number, 443:

sudo ufw allow 443/tcp

If you are using Iptables, you can use the following command to allow incoming connections to port 443

sudo iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT

Regards,
KDSys

This is the first time I have met this case, however, following my experience, I often contact the sellers for more supports. They are normally welcome to solve this via teamviewer.

Submit an Answer