?
Solved

linux apache server not found within LAN

Posted on 2003-03-13
7
Medium Priority
?
264 Views
Last Modified: 2013-12-16
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...

0
Comment
Question by:pjgeorge
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 9

Accepted Solution

by:
majorwoo earned 300 total points
ID: 8128148
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 http://192.168.2.102 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 192.168.2.150 you can add to /etc/hosts

192.168.2.150       webserver

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

Expert Comment

by:heskyttberg
ID: 8128159
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
0
 

Author Comment

by:pjgeorge
ID: 8128291
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!
0
Technology Partners: 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!

 

Author Comment

by:pjgeorge
ID: 8132887
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.
0
 
LVL 8

Expert Comment

by:heskyttberg
ID: 8134678
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
0
 

Author Comment

by:pjgeorge
ID: 8135349
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.
0
 
LVL 9

Expert Comment

by:majorwoo
ID: 8136416
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.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question