Young L.
Young L.

Reputation: 1042

Wordpress can't reach a page after added SSL certificate to my VPS

Hi I tried to add WordPress web online but i have some issues with SSL (LetsEncrypt). After i install it exactly like in this link bellow:

https://websiteforstudents.com/switch-wordpress-from-http-to-https-on-ubuntu-with-lets-encrypt-and-apache2/

The page is just loading for a while and then it just show ERR_CONNECTION_TIMED_OUT.

I think everything should be ok but don't know why it no work.

.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
</IfModule>
# END WordPress

wordpress-ls-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/wordpress/
     ServerName example.com
     ServerAlias www.ecample.com

     <Directory /var/www/html/wordpress/>
        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/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>

apache2 wordpress.conf


<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/wordpress/
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/wordpress/>
        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} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Without SSL it works fine. And also I changed in database wordpress links to https://

Upvotes: 0

Views: 263

Answers (1)

Young L.
Young L.

Reputation: 1042

I forgot to unblock the port.

sudo ufw allow https

Upvotes: 1

Related Questions