LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-17-2003, 04:43 PM   #1
jenna_h
Member
 
Registered: Nov 2002
Distribution: Mandrake 9.0
Posts: 58

Rep: Reputation: 15
Web server not accessible from other PCs


Hi, I just started running a webserver from my computer (apache 1.3 on Mandrake 9.1) and have run into a slight problem. Apache is running fine, but when I enter the IP of my network in a web browser, it can't find the server. I can access other websites fine, and I can access my own site if I enter the number 127.0.0.1, but I just can't access it by entering either the LAN IP or the WAN IP. I'll probably kick myself when I find out what the problem is, but if anyone has suggestions I'd appreciate it.
 
Old 12-17-2003, 05:31 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
It sounds like a firewall rule blocking port 80. Post the output of:
iptables -nL
 
Old 12-17-2003, 05:49 PM   #3
beyer42
Member
 
Registered: Dec 2003
Location: San Jose
Distribution: Redhat WS 3
Posts: 410

Rep: Reputation: 30
Make sure that ServerName in httpd.conf is uncommented and set to
the IP address of the machine, then stop and start Apache.

I am guessing that you have your hostname in 127.0.0.1 line
in /etc/hosts and you used your hostname as the NameServer entry.
 
Old 12-17-2003, 06:07 PM   #4
jenna_h
Member
 
Registered: Nov 2002
Distribution: Mandrake 9.0
Posts: 58

Original Poster
Rep: Reputation: 15
ServerName wasn't set to the right number, so I changed that and restarted Apache. No difference, though. And I doubt there's a problem with the firewall, since the only firewall is the one running on my router and it's set to leave port 80 open. But anyways, the output of iptables -nL is:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

This is a mystery to me since I'm not familiar with iptables. But maybe you can see a problem. Thanks!
 
Old 12-17-2003, 06:16 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
The server name shouldn't really matter.

Your firewall is ok.

What machines are you testing the connection from? Are you trying with your lan IP from another lan machine? You probably will not be able to use your public IP from within your lan. To use your public IP from outside your lan you will need to forward port 80 on the router to port 80 the linux box.

You may also want to confirm that apache is not just listening on the loopback address. Post the output of:
netstat -nlp
 
Old 12-17-2003, 09:34 PM   #6
jenna_h
Member
 
Registered: Nov 2002
Distribution: Mandrake 9.0
Posts: 58

Original Poster
Rep: Reputation: 15
I've been typing in my external IP on the machine that's running the server, and I know that doesn't work. I won't be able to tell if it's visible from a machine outside the network until I get a chance to try one at the library, but the last time I checked, it wasn't. I've had it working before, though, so I know that it's at least do-able. My output from netstat -nlp is as follows:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:32768 0.0.0.0:* LISTEN 1392/xinetd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 942/
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 15411/httpd
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1394/X
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 1423/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1682/
udp 0 0 0.0.0.0:513 0.0.0.0:* 1518/rwhod
udp 0 0 127.0.0.1:53 0.0.0.0:* 1365/
udp 0 0 0.0.0.0:68 0.0.0.0:* 9001/dhclient
udp 0 0 224.0.0.251:5353 0.0.0.0:* 1365/
udp 0 0 192.168.0.6:5353 0.0.0.0:* 1365/
udp 0 0 127.0.0.1:5353 0.0.0.0:* 1365/
udp 0 0 0.0.0.0:111 0.0.0.0:* 942/
udp 0 0 0.0.0.0:631 0.0.0.0:* 1423/cupsd

Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 5621 2258/xmms /tmp/xmms_jim.0
unix 2 [ ACC ] STREAM LISTENING 3997 1682/ private/rewrite
unix 2 [ ACC ] STREAM LISTENING 4001 1682/ private/bounce
unix 2 [ ACC ] STREAM LISTENING 3405 1346/saslauthd /var/lib/sasl2/mux
unix 2 [ ACC ] STREAM LISTENING 4005 1682/ private/defer
unix 2 [ ACC ] STREAM LISTENING 4013 1682/ private/proxymap
unix 2 [ ACC ] STREAM LISTENING 4017 1682/ private/smtp
unix 2 [ ACC ] STREAM LISTENING 4021 1682/ private/relay
unix 2 [ ACC ] STREAM LISTENING 4029 1682/ private/error
unix 2 [ ACC ] STREAM LISTENING 4033 1682/ private/local
unix 2 [ ACC ] STREAM LISTENING 4037 1682/ private/virtual
unix 2 [ ACC ] STREAM LISTENING 4041 1682/ private/lmtp
unix 2 [ ACC ] STREAM LISTENING 4045 1682/ private/maildrop
unix 2 [ ACC ] STREAM LISTENING 4049 1682/ private/old-cyrus
unix 2 [ ACC ] STREAM LISTENING 4053 1682/ private/cyrus
unix 2 [ ACC ] STREAM LISTENING 4057 1682/ private/uucp
unix 2 [ ACC ] STREAM LISTENING 4061 1682/ private/ifmail
unix 2 [ ACC ] STREAM LISTENING 4065 1682/ private/bsmtp
unix 2 [ ACC ] STREAM LISTENING 3990 1682/ public/cleanup
unix 2 [ ACC ] STREAM LISTENING 4009 1682/ public/flush
unix 2 [ ACC ] STREAM LISTENING 4025 1682/ public/showq
unix 2 [ ACC ] STREAM LISTENING 3620 1313/ /tmp/.gdm_socket
unix 2 [ ACC ] STREAM LISTENING 7054 2264/gaim /tmp/gaim_jim.2264
unix 2 [ ACC ] STREAM LISTENING 3281 1238/ /tmp/.font-unix/fs-1
unix 2 [ ACC ] STREAM LISTENING 3655 1394/X /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 5427 2249/esd /tmp/.esd/socket
 
Old 12-17-2003, 11:30 PM   #7
robe8
LQ Newbie
 
Registered: Aug 2003
Location: United States of California
Distribution: Red Hat 9.0
Posts: 17

Rep: Reputation: 0
The only for sure thing if Apache is being blocked by your firewall settings is to port scan your web server see if port 80 is responding. Also, you can telnet or netcat to your servers IP addy but make sure to use port 80 then type HEAD / HTTP/1.0 if it connects to the server. If it doesn't respond its your firewall settings either its ipchains/iptables or your hosts.allow and hosts.deny has been modified differently. Your web server is running fine if you're able to connect to localhost most likely its the firewall blocking the server.
 
Old 12-18-2003, 02:17 AM   #8
auximini
Member
 
Registered: Dec 2003
Location: Calgary, AB
Distribution: Any!
Posts: 146

Rep: Reputation: 18
In your httpd.conf, look for "Listen" and "BindAddress" and see if they are set to localhost or 127.0.0.1. If they are, remove them.

You could also even try grepping for 127.0.0.1 in httpd.conf by typing:
# grep 127.0.0.1 httpd.conf

It's also possible that your ISP has started to block port 80. You can also try making apache listen on some obscure port like 7777 and then see if you can reach it by going to http://externalIP:7777
 
Old 12-18-2003, 02:06 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Well you can see that apache is listening on all interfaces to port 80 from the netstat output:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 15411/httpd

If you want to test from outside your network (without gettng out of your chair) then use a web proxy like guardster.com
 
Old 12-18-2003, 02:11 PM   #10
auximini
Member
 
Registered: Dec 2003
Location: Calgary, AB
Distribution: Any!
Posts: 146

Rep: Reputation: 18
duh

> Well you can see that apache is listening on all interfaces to port 80 from the netstat output:
> tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 15411/httpd

duh.. missed that line
 
Old 12-18-2003, 02:15 PM   #11
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
You could still be right about the ISP blocking the request but at least we know it should be accessible from the rest of the LAN.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Server not accessible (TPM) Croaker Linux - Software 1 01-14-2005 10:06 PM
SAMBA Server not accessible compassmanwi Linux - Networking 3 08-26-2004 08:50 PM
Server not accessible from internet checta Linux - Networking 5 05-11-2004 06:30 AM
samba server is not accessible mla Linux - Software 5 09-30-2003 05:55 PM
ssh and ftp server not accessible bbenz3 Linux - Networking 1 03-04-2002 07:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration