0

I have 3 WordPress installed on my Ubuntu in /var/www/html directory. There was no issue from last two years. But recently while I am installing another script in the same directory, I had to purge and reinstall the apache2.

And after that, I am unable to access my all websites. It says "Unable to connect"

When I entered IP address it's showing the Apache server home page instead of 3 directory page that was shown before.

I have tried to restart the Apache server and its running well but still no result.

  • www.misources.com
  • www.trackerplanet.com
  • www.mypan.co.in
1

Because you have not configured your webserver to accept TLS traffic, commonly known as https.

If we check the reply for the website, using curl -I we see that http://www.misources.com redirects to https://www.misources.com:

$ curl -I www.misources.com
HTTP/1.1 301 Moved Permanently
Date: Tue, 31 Dec 2019 13:38:32 GMT
Server: Apache/2.4.29 (Ubuntu)
Location: https://www.misources.com/
Content-Type: text/html; charset=iso-8859-1

If we try to follow that redirect, like your browser would, we get a connection denied:

$ curl -I https://www.misources.com/
curl: (7) Failed to connect to www.misources.com port 443: Connection refused

The same is the case for the rest of your domains as well. You have probably not loaded the ssl module. I suggest you try sudo a2enmod ssl, and restart your webserver.

You should probably check your configuration as well.

However, you should not have to purge apache to fix any issues with a script. That's nonsensical. The Apache installation does not interfere with your content directories.

7
  • Hi, thanks for your answer. It works but now I am getting "This site can’t provide a secure connection" "ERR_SSL_PROTOCOL_ERROR" on the browser. Still unable to access my site. Please reply for the next suggestion Dec 31 '19 at 14:23
  • @IrfanHabib See my updated answer. In short, you have to recreate the configuration as it was. Given your level of knowledge, I would generally suggest to stick with managed hosting...
    – vidarlo
    Dec 31 '19 at 14:41
  • Hello again. after i run "a2ensite default-ssl" its showing the apache server home page instead my wp site without ssl Dec 31 '19 at 14:42
  • Your TLS config is BROKEN. Don't go around blindly running commands. Configure it correctly. It's laid out in the linked documentation above - or you can make a new question about it. As it is now, it returns an invalid certificate, so you have to configure it with correct certificates.
    – vidarlo
    Dec 31 '19 at 14:46
  • what if I delete or revoke ssl? anyway I am using letsencrypt ssl Dec 31 '19 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.