I've set up a web server on our workplace domain. The server has been configured so that Apache works on it and everything seems to be working fine.

However, I am struggling to access the machine via a web browser. I've typed in the IP address of the machine, and the browser comes back saying the page can't be displayed. I've also tried pinging the IP address of the machine and I do get a response back.

I've also checked to see if Apache (httpd) is running, and I can confirm it is. Here is the hosts file held on the server (the domain is company.internal): localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 localhost redrum.company.internal

I have also edited the httpd.conf file by adding this:


What else could be causing the problem?

I ran netstat and the only entry for httpd is set to listen. Using the command fuser 80/tcp I got this information:

80/tcp: 1476 1478 1479 1480 1482 1483 1484 1485 1486

I then ran ps aux | grep 1476 | grep -v grep which returned:

root 1476 0.0 3.7 432020 18912 ? Ss 12:00 0:00 /usr/sbin/httpd

Then finally ran pgrep httpd which returned this:


So httpd is running and listening on port 80.

EDIT 2: I've ran the netstat -an | grep :80 and this returned the following information:

tcp 0 0 :::80 :::* LISTEN

  • Check to see what port and IP address Apache's listening socket is bound to. (Use netstat.) – David Schwartz Nov 15 '12 at 12:10
  • I've updated the question with the new information. – mickburkejnr Nov 15 '12 at 12:26
  • We need to see what port and IP address Apache's listening socket is bound to. You can find the output in netstat -an | grep :80 – David Schwartz Nov 15 '12 at 12:31
  • Question has been updated :) – mickburkejnr Nov 15 '12 at 12:46
  • The listening socket looks right. My next guess would be either a firewall (on the server) or a proxy (configured on the client). – David Schwartz Nov 15 '12 at 12:47

I'm sure it's a firewall (as David Schwartz mentioned). CentOS iptables doesn't allow HTTP access by default. Please run iptables -F and check if problem still exists. You can edit /etc/sysconfig/iptables to make permanent changes.

  • It transpires that the internal firewall to the office was the cause. I added the IP to be bypassed in the browser and it worked. Thank you everyone. – mickburkejnr Nov 15 '12 at 13:22
  • i had no idea centos 6.8 activated iptables out-of-the-box due to my only experiences being pre-provisioned dedicated servers. iptables -F was all it took for my LAN linux box to start serving web sites properly. thanks! – aequalsb Feb 10 '17 at 17:29

Not a complete answer but: FWIW, the command you want to answer the question "What's listening on port X?" is lsof. My usual incantation there is lsof -i -Pn | grep LISTEN


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.