Score:0

Apache server not responding. It just loads and then gives a timeout

ng flag

I have an apache2 server and have been trying to make it accessible to all but am unable to do so. Here are the outputs:

$ netstat -plant | grep apache
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN    15647/apache2

earlier it was :::80, but I changed it after seeing another post on serverfualt.com

$ ufw status
Status: inactive
$ service apache2 status
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-08-28 18:33:05 UTC; 16min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 15625 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 15647 (apache2)
      Tasks: 55 (limit: 4617)
     Memory: 12.5M
     CGroup: /system.slice/apache2.service
             ├─15647 /usr/sbin/apache2 -k start
             ├─15648 /usr/sbin/apache2 -k start
             └─15649 /usr/sbin/apache2 -k start

Aug 28 18:33:05 localhost systemd[1]: Starting The Apache HTTP Server...
Aug 28 18:33:05 localhost systemd[1]: Started The Apache HTTP Server.

When I try to access it from browser, it just keeps on oading and after some point gives site takes too long to respond error.

Please help me resolve it. Also if any other output will be required, please inform me.

Michael Hampton avatar
cz flag
What is the domain name? What is the IP address?
Divyessh avatar
ng flag
I can not provide you the domain and the IP, can you tell me what you need it for? @MichaelHampton
Nikita Kipriyanov avatar
za flag
How exactly did you connect to this server via browser?
Score:2
in flag

You already checked that the service is running.

Try to access your server from the server itself, in order to check if the service is accessible. A adequate command to check is telnet or curl, to be executed on the same machine the server is running:

$ telnet localhost 80
$ curl -v http://localhost

If this is working well, next is to check if the firewall on the server has opened port 80. Hint: ufw is just one type of firewall, there could be other programs as well. Please also check if another firewall ( for instance the one of your server provider) allows access to port 80.

Next step is to try the same, but to use the Public IP of the server. A command to know your public IP of the server is echo $(curl -s ifconfig.me). Another way is to search for it in the output of ip a.

Finally you should check the DNS, eg. if your domain name points to the correct IP.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.