PLEASE HELP! Can't reach site after installing SSL


#1

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


Help asap, my website died after installing ssl
#2

Hi @freaks

checking your site via https://check-your-website.server-daten.de/?q=freaks.vip - 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.


#4

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


#5

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

Do you have ssh access?


#6

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.


#7

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>

#8

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


#9

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


#10

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

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


#11

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.


#12

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


#13

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.


#14

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


#15

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


#16

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.


#17

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


#18

There may be a file like

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

or ssl-default etc.


#19

/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


#20

Use the ls - list - command

ls -al

#21

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.