• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

linux apache server not found within LAN

Hello, apologizes up front if this has been asked before - Google's EE site search turned up nothing after 14 pages of looking! Ugg. Also, first post here (be gentle)...

I am new to Linux but I was a beginner UNIX admin type about 4 years ago - a bit rusty.

I have a Home network that looks like this:

Internet --> Cable Modem --> LinkSys Wireless Access Point Router with 4-Port Switch (Model BEFW11S4) --> 3 desktop machines

Currently all 3 machines are _wired_ to the hub, so the wireless part is out of the picture.  The three machines are: - P4 2.4 GHz running WinXP - P1 133Mhz running RedHat Linux 8 - vanilla install from CD - Pentium Celeron 500 running WinXP

All three machines are getting IP addresses via DHCP and when I log into the router ( it shows them all in the DHCP table.

I am running Linux in line (server) mode.

I have configured apache to run on the Linux box Listening to Port 80 (http) and 443 (https) and from that same box I can telent to port 80 and type GET / HTTP1/1.1 (or what ever the command is) and it pipes out the index.html contents to my screen.

From the WinXP machines using IE I cannot browse to

I can ping the Linux box using its IP address from both WinXP machines.  Telnet is not running on the Linux box so I cannot telnet to it from the WinXP machines.  Tonight I will start telnetd and see if I can get to port 80 via "telnet 80" and see if that works. I will add comments then.

In the mean time....
If I can telnet to port 80 and get a response from "GET /" but still cannot browse to port 80, what should I be looking at? The browser settings??

If I cannot get any response from telnet from another box what should I look at? Router firewall?  Linux Firewall?  I did not see ipfilter running by looking at the output from "netstat -r" - but I am not exactly sure what I'm looking for.....

Also, what should be in the /etc/hosts file? I want to get this to work locally first, but will eventually open port 80 on the router and use DynDNS to point to my Linux box to serve up a domain name that I own....

Any clues or debugging steps would be greatly appreciated...

  • 3
  • 2
  • 2
1 Solution
ok, try telnet and see where you get.

also make sure that the linux box still is .102 as DHCP can change that on you, perhaps a winxop machine is now 102 and linux is 103 who knows......

the browset settings are most likley not involoved here, assuming the browser can get to the internet im sure its fine.

its possible your linux machine has some sort of firewall running that is blocking it (1st guess)  When you installed redhat 8 it probably installed the default iptables. depending on how you chose when you did the firewall,

/sbin/iptables -L

will show you your iprules, you want to see something like:

ACCEPT     tcp  --  anywhere           yourip_here NEW,RELATED,ESTABLISHED tcp dpt:80

that should be your firewall letting http traffic in (also on 443)  If that is not there your firewall is blocking it, but if it is not there and nothing is then you may not hav a firewall at all ;-)

When you browse to what does the browser say? connection refused?

your /etc/hosts file handles aliases, for example once this works and you say give your linux a static you can add to /etc/hosts       webserver

then from the linux box, http://webserver would work

Well you can telnet to your linux box without starting telnetd, since you are going to telnet to port 80 anyway.

Just do this on XP box:
telnet linuxserver 80

Same thing will happen as when you did this locally on the linux box. Do a GET /index.html, for example.

Another thing to try in IE is:

If this isn't working, check /etc/httpd/conf/httpd.conf or where your conf file are located, find the ServerName, Listen directive. This needs to be set, try to add the servername to the local hosts file in XP and give it the IP of linux box.

Now surf to that. Also try adding Listen

Hope any of this helps.

/Hans - Erik Skyttberg
pjgeorgeAuthor Commented:
I confirmed the IP address from the router's DHCP tables many times while trying to debug.  I will definitely go to static IP asap. Thanks!  I will check iptables too.

When I browse to from the WinXP box I get nothing for a really long time, then (unfortunately) I did not look to see what the eventual error message was - sorry, I will look tonight.  Thanks for the comments! I will post an update as soon as I get home! :-)

Thanks for the telnet tip, I forgot telnetd would only listen to port 23 anyway. :-)  

Currently, when i run
   telnet 80
from the winXP box I get nothing back for a while, then an error message - just like the web browser.  I only wish I could recall the exact error message - Sorry! :P

I have been websurfing on this still and wanted to bounce something new off you all.

Does the vanilla RedHat 8 install come with entries in the /etc/hosts.allow and /etc/hosts.deny tables that would restrict other machines from browsing to it?  I have not edited these files yet. But I read somewhere that I need to comment out all the entried in the deny file and make sure only one entry is in the allow file (*.*.*.*).  Does this sound like a reasonable "first step"??

Thanks again!
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

pjgeorgeAuthor Commented:
Okay, first overnight the IP changed to 101 for the Linux box - I'll get that straight.

Anyway, running

telnet 80

returns this:

Connecting To not open connection to the host, on port 80:  Connect failed

Entering into the browser returns this after a while:

Cannot find server or DNS Error

I ran iptables -L and it showed a whole bunch of REJECTS and ACCEPTS, but none like you (majorwoo) describe.  One says

ACCEPT    all   --   anywhere  anywhere

This is the last ACCEPT line.  Not sure if that helps.

The httpd.conf file has the right IP address in ServerName and Listen 80 is set.

Would it be bad to clear out iptables with "iptables -F"?  Or can I turn it off temporarily for testing?

Thanks again.

For testing it's safe to turn off firewall rules.
Easiest is to just do ip tables stop, not flushing the tables.

In RH you can do /etc/init.d/iptables stop or
/etc/init.d/ipchains stop depending on which you are using.

/Hans - Erik Skyttberg
pjgeorgeAuthor Commented:
Majorwoo, your "(1st guess)" was on the money.  Disabling the firewall allowed me to immediately server http to other machines. Thanks a ton!

heskyttberg, I wish I could award secondary points.  Thank you VERY much for your tips on iptables, you are an asset to the EE community.

for futur ereference when something like this happens, you are able to post a 0 pt question in community support and ask to reduce the points you are giving one person, then post another question like "Pts for heskyttberg" -> that is how to split pts between two (or more) experts.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now