Link to home
Start Free TrialLog in
Avatar of pjgeorge
pjgeorge

asked on

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:
   192.168.1.101 - P4 2.4 GHz running WinXP
   192.168.1.102 - P1 133Mhz running RedHat Linux 8 - vanilla install from CD
   192.168.1.103 - Pentium Celeron 500 running WinXP

All three machines are getting IP addresses via DHCP and when I log into the router (192.168.1.1) 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 http://192.168.1.102

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 192.168.1.102 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...

ASKER CERTIFIED SOLUTION
Avatar of majorwoo
majorwoo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of heskyttberg
heskyttberg

Hi!

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:
http://192.168.1.101

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 192.168.1.101:80.

Hope any of this helps.

Regards
/Hans - Erik Skyttberg
Avatar of pjgeorge

ASKER

majorwoo,
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 192.168.1.102 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! :-)

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

Currently, when i run
   telnet 192.168.1.102 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!
Okay, first overnight the IP changed to 101 for the Linux box - I'll get that straight.

Anyway, running

telnet 192.168.1.101 80

returns this:

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

Entering http://192.168.1.101/ 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.
Hi!

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.

Regards
/Hans - Erik Skyttberg
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.

Paul.
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.