PLEASE HELP! Can't reach site after installing SSL

I installed SSL and when i go to my site it says:

This page isn’t working

freaks.vip redirected you too many times.

I run Ubuntu 18
Apache 2
Skill level: complete NOOB

Hi @freaks

checking your site via freaks.vip - Make your website better - DNS, redirects, mixed content, certificates - there are unusual redirects:


https://www.freaks.vip/ -14 10.033
Timeout - The operation has timed out
http://freaks.vip 301 https://freaks.vip/ 0.016
http://freaks.vip/ 301 https://freaks.vip/ 0.127
http://www.freaks.vip/ 302 http://www.freaks.vip/ 0.390
https://freaks.vip/ 302 http://freaks.vip 0.093

The second and the third are good. But the next two are bad. Self - redirect http + www -> http + www and a redirect https -> http, both are wrong.

So check your Port 80 / www - definition to find the self redirect.

And your https should never redirect to http.

Thank you so much sir! but i really don’t understand what to do…
I’m a complete noob, what should i change or where?
Please help me, i’m losing my visitors… :frowning: or at least how can i get my site back to http:// if it’s not possible to fix ssl

How did you create your certificate? Do you use a tool like cPanel? Or Certbot?

Do you have ssh access?

Using Certbot. Yes i have access through PuTTy
I installed SSL as the guide showed: https://certbot.eff.org/lets-encrypt/ubuntubionic-apache
My website is : freaks.vip and now it says ‘‘ERR_CONNECTION_REFUSED’’ when i’m trying to access my website through google chrome, please help.

Can you share your apache configuration file? The file

https://httpd.apache.org/docs/2.4/configuring.html

httpd.conf.

This file may include other files. Search something like

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

Ubuntu doesn’t use httpd.conf as far as i know and ubuntu uses /etc/apache2/apache2. and here’s what it has:

Please copy the text, it’s impossible to read that.

sorry i found different one that might be better:

root@localhost:/# vim /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

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

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

RewriteEngine on
RewriteCond %{SERVER_NAME} =freaks.vip
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

vim: syntax=apache ts=4 sw=4 sts=4 sr noet

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

First step (not the solution): Add # before these two rows, so the redirect http -> https is removed

Then search the ssl - configuration, there must be a redirect https -> http, this is wrong.

I will! thanks!
Here’s full code:

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

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

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

RewriteEngine on
RewriteCond %{SERVER_NAME} =freaks.vip
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I added # as you told me, unfortunately nothing changed :frowning:
Could you please help me out? I can give you access to my VPS root user.
I promise i’ll pay you withing next 5 days, i must fix it asap cuz i’m losing my visitors, i don’t have many but i don’t wanna lose those few.

Did you reload your webserver? It won't know about the changes you made until you do that. I believe you'll want to run the command systemctl reload apache2 for your changes to take effect

OMG! you saved my life!
It worked but website doesn’t have SSL certificate, it still says ‘‘Not secure’’ what’s the issue sir?

1 Like

Now the redirect http -> https is removed. So there is no longer a loop.

So now find the second redirect https -> http. Find something like

Listen 443
<VirtualHost *:443>
    ServerName www.example.com
    SSLEngine on
    SSLCertificateFile "/path/to/www.example.com.cert"
    SSLCertificateKeyFile "/path/to/www.example.com.key"
</VirtualHost>

With a redirect https -> http.

1 Like

I don’t know where to find it sir, i installed ssl the way it says on Certbot site…
Where would it be that Virtualhost *: 443?
I apologize for being such a noob, but i don’t know where else to seek help

There may be a file like

/etc/apache2/sites-available/ssl.conf

or ssl-default etc.

/etc/apache2/sites-available/ssl.conf - is empty sir.
how can i display all the folder names in /etc/apache2/ ?
That way i’ll be able to find files and folders if i could see them

Use the ls - list - command

ls -al

I did my best sir but i couldn’t find it, would it be possible for you to have a look at it if i give you the access? or do you know someone who would to that? of course if it takes a minute or two.