ERR_ADDRESS_UNREACHABLE when accessing my website without https

7.8k Views Asked by At

First of all, just letting you know i have a little experience with web servers and therefore, my questions might be very novice.

I am experiencing issue with my newly created website. I have a CentOS 7 server for another website and i would like to add a new website with a different URL to this server.

The configurations for the websites are, from what i understand, in /etc/httpd/conf.d.

I have created a new .conf file for my website:

    <VirtualHost *:443>

    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP

    #SSLCertificateFile      /etc/pki/tls/certs/localhost.crt
    #SSLCertificateKeyFile   /etc/pki/tls/private/localhost.key
    #SSLCACertificateFile    /etc/pki/tls/certs/ca-bundle.trust.crt

    SSLCertificateFile      /etc/letsencrypt/live/******/cert.pem
    SSLCertificateKeyFile   /etc/letsencrypt/live/******/privkey.pem
    #SSLCACertificateFile   /etc/letsencrypt/live/******/chain.pem
    SSLCACertificateFile    /etc/letsencrypt/live/******/fullchain.pem

    ServerName      mywebsite.com
    DocumentRoot    /var/www/myproject

    ErrorLog /var/log/httpd/ssl-mywebsite.com-error_log
    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel error
    CustomLog /var/log/httpd/ssl-mywebsite.com-access_log combined

    <Directory /var/www/myproject>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName mywebsite.com
    DocumentRoot /var/www/myproject

    <Directory /var/www/myproject>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/mywebsite.com-error.log
    LogLevel warn
    CustomLog /var/log/httpd/mywebsite.com-access.log combined
</VirtualHost>

For some reason, the only VirtualHost that works is the 443 one. When i am trying to reach the website without the https:// it gives me this error:

This webpage is not available

ERR_ADDRESS_UNREACHABLE

Is there another configuration i am not aware of that disables the not-secured traffic?

If more details are needed let me know and i will provide them.

Thanks!

1

There are 1 best solutions below

1
On BEST ANSWER

Verify if the CentOS7 firewall is blocking the http traffic:

[root@stage2 ~]# firewall-cmd --list-all
public (default, active)
  interfaces: eno16777984
  sources:
  services: dhcpv6-client https ssh
  ports: 5000/tcp
  masquerade: no
  forward-ports:
  icmp-blocks:
  rich rules:

If you don't see http in services:, or 80/tcp in ports: then you need to add a http service to your zone:

[root@stage2 ~]# firewall-cmd --permanent --zone=public --add-service=http
success

After that reload your firewall to get access to your new service:

[root@stage2 ~]# firewall-cmd --reload
success

And verify that http is opened:

[root@stage2 ~]# firewall-cmd --list-all
public (default, active)
  interfaces: eno16777984
  sources:
  services: dhcpv6-client http https ssh
  ports: 5000/tcp
  masquerade: no
  forward-ports:
  icmp-blocks:
  rich rules: