Why can not visit the site suddenly | Centos 7 !

There are many reasons why you can not visit your website. The possible reasons could be

1. Port 80 is not running

2. Server configuration changed

3. Firewall is closed

4. Domain expired

5. Being attacked

In this article we will be talking about the reasons 1, 2 and 3 as well as we will provide solutions.

1. Port 80 is not running

Maybe the port 80 is not running or shut down for some reasons. This is the first thing we should check if you can not visit your website. Open your centos terminal and type in

-->sudo lsof -i -P -n

It should give you output like below

Centos 7 website down port 80

The above output in your case might be a little different. But anyway you should see port 80 is running(Listening). If you see port 80 is not running then use the command below

--> service restart httpd

After this command you should be able to visit your site. Of course while you run the command you can specify the port name like this

--> sudo lsof -i:80

The above command will only look for port 80.

2. Server configuration file changed

If you tried reason 1's solution but still not working then go to your centos terminal and open your httpd.conf file using the command 

--> vim /etc/httpd/conf/httpd.conf

You need to look for a line "Listen 80". See if this is commented out. If it is commented out then uncomment it and save your file. And then run the command on terminal to restart your apache server.

--> service httpd restart

Now visit your site and you should be able to visit it.

3. Firewall is closed

If reasons 1 and 2 solutions did not work then try to restart your firewall or iptables

-->systemctl restart iptables

Most of the time the above three solutions should work for three reasons why your website is down. Thanks.