Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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):

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.10 localhost redrum.company.internal

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

ServerName 192.168.1.10:80

What else could be causing the problem?

EDIT
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:

1476
1478
1479
1480
1481
1482
1483
1484
1485
1486

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

share|improve this question
    
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

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
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

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

-Robin

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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