LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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-12-2003, 08:31 PM   #1
boemitsu
LQ Newbie
 
Registered: Dec 2003
Location: Zurich
Distribution: slackware 9.1, mandrake 9.1
Posts: 17

Rep: Reputation: 0
Question localhost


hello

I've really got a very strange problem with localhost, and I don't have any idea how to fix it...hope you guys can give me a hint.

I'm running slackware 9.1 on a linuxbox acting as a router/webserver.

my problem is, that I can access the webserver from the internet/intranet, but not from localhost.

the same problem is with ping, I get response from google.com
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 107.544/108.098/108.652/0.554 ms

but when I try ping localhost (or 127.0.0.1 or entries in /etc/hosts), I only get
PING localhost (127.0.0.1) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted

--- localhost ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1016ms

the output from route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
80.219.32.0 * 255.255.240.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 80-219-32-1.dcl 0.0.0.0 UG 0 0 0 eth0

the output from iptables -L -v (
of course this is for testing purposes....)
Chain INPUT (policy ACCEPT 2917 packets, 1330K bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 2269 packets, 284K bytes)
pkts bytes target prot opt in out source destination


and finally from ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:C0:26:8E:23:15
inet addr:80.219.41.xxx Bcast:255.255.255.255 Mask:255.255.240.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44501398 errors:0 dropped:0 overruns:0 frame:0
TX packets:11966 errors:0 dropped:0 overruns:0 carrier:0
collisions:17 txqueuelen:100
RX bytes:2690286557 (2565.6 Mb) TX bytes:1668027 (1.5 Mb)
Interrupt:10 Base address:0xecc0

eth1 Link encap:Ethernet HWaddr 00:00:F8:79:A7:4E
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55 errors:3 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:11320 (11.0 Kb) TX bytes:0 (0.0 b)
Interrupt:9 Base address:0xec00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)



lo is up, a routing table entry is availible, there is no iptables rule blocking anything at all....??



PLEASE HELP

thx !
 
Old 12-13-2003, 06:17 AM   #2
boemitsu
LQ Newbie
 
Registered: Dec 2003
Location: Zurich
Distribution: slackware 9.1, mandrake 9.1
Posts: 17

Original Poster
Rep: Reputation: 0
does nobody have a little hint...? slackware users...?
 
Old 12-13-2003, 08:07 AM   #3
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
It looks like a firewalling trouble. Have you tried stopping iptables completely and then retrying?

/etc/init.d/iptables stop
in redhat, don't know for suse
 
Old 12-13-2003, 08:42 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It doesn't look like a firewall problem since all teh chains are set to ACCEPT.

Check that you have a localhost entry next to the loopback address in /etc/hosts. Can you ping the loopback address directly:
ping -c 3 127.0.0.1
 
Old 12-13-2003, 08:51 AM   #5
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Yes, he said he tried with the ip add.

Can you ping it from another machine? or access a service like sendmail or ssh?
 
Old 12-13-2003, 11:18 AM   #6
boemitsu
LQ Newbie
 
Registered: Dec 2003
Location: Zurich
Distribution: slackware 9.1, mandrake 9.1
Posts: 17

Original Poster
Rep: Reputation: 0
thx guys for taking time to help me with this prob !

@ugob
I can establish a ssh connection to my box, ping is also possible from intranet and internet....

the output of /etc/hosts

# For loopbacking.
127.0.0.1 localhost

# End of hosts.


I also tried to add a entry like

127.0.0.1 m3

but without success.

if u need further information, please let me know that, and I will post it as soon as possible.

many thanks
 
Old 12-13-2003, 02:41 PM   #7
boemitsu
LQ Newbie
 
Registered: Dec 2003
Location: Zurich
Distribution: slackware 9.1, mandrake 9.1
Posts: 17

Original Poster
Rep: Reputation: 0
?

.

Last edited by boemitsu; 12-13-2003 at 06:44 PM.
 
Old 12-13-2003, 04:11 PM   #8
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Re: ?

Quote:
Originally posted by boemitsu
anybody out there ??
Wait a minute, man, I don't stay in front of my computer just in case you need help...

With what user do you ping, locally, have you tried it with root? It may be a permission on the executable itself.

http://info.ccone.at/INFO/Mail-Archi.../msg00039.html
 
Old 12-13-2003, 05:01 PM   #9
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Are you sure your webserver is even bound to a loopback IP? If Apache is only bound to your public IP, then you would need to connect to it with that IP. If you don't have a nameserver configured in /etc/resolv.conf and the only thing in /etc/hosts in 127.0.0.1, then you have no way of reaching your web server by name.

Oh, so any way the point is to do a
$ netstat -anA inet
and paste the output.
 
Old 12-13-2003, 06:42 PM   #10
boemitsu
LQ Newbie
 
Registered: Dec 2003
Location: Zurich
Distribution: slackware 9.1, mandrake 9.1
Posts: 17

Original Poster
Rep: Reputation: 0
@ugob
I did't want to put you under stress....sorry if you feel so.

root@m3:~# netstat -anA inet
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:79 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 80.219.41.x:22 80.219.30.x:1208 ESTABLISHED
udp 0 0 0.0.0.0:512 0.0.0.0:*
udp 0 0 0.0.0.0:518 0.0.0.0:*
udp 0 0 0.0.0.0:37 0.0.0.0:*
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
raw 0 0 0.0.0.0:1 0.0.0.0:* 7


root@m3:~# cat /etc/resolv.conf
nameserver 62.2.17.61
nameserver 62.2.24.158
nameserver 62.2.17.60
nameserver 62.2.24.162
root@m3:~#
 
Old 12-13-2003, 09:22 PM   #11
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
chort: I don't see what this has to do with the apache web server, we're only trying to ping the localhost...

boemitsu: I didn't feel stressed but your question will not be answered more rapidly if you do that... could have an adverse effect, in fact.

Did you check what I suggested? Looked at the link?

Have you only searched a bit on google on your problem?
 
Old 12-13-2003, 10:29 PM   #12
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Doesn't have anything to do with pinging localhost, but the fact that he can't ping lo0 might be entirely unrelated to not being able to view the website from that machine, which was the whole point of the question in the first place.

However, we established that: Yes, Apache is bound to 127.0.0.1 as well as the Internet IP.
 
Old 12-13-2003, 10:32 PM   #13
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
Sorry, I didn't remember that he said "able to see website from intranet but not from localhost.

Pretty weird problem.
 
Old 12-14-2003, 12:30 AM   #14
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
It might be in /etc/nsswitch.conf or not as likely in /etc/host.conf

What's in those files?


Maybe run ldconfig just for giggles

Last edited by DavidPhillips; 12-14-2003 at 12:34 AM.
 
Old 12-14-2003, 12:34 AM   #15
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
What have you updated or installed lately?
 
  


Reply



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
Change localhost name in username@localhost n175uj Linux - Newbie 4 07-01-2005 08:25 PM
apache http://localhost/mysite ---> http://localhost/mysite/index.php how? ilnli Linux - General 8 06-04-2005 03:23 PM
Message from syslogd@localhost localhost kernel: Disabling IRQ #21 ylts Linux - Hardware 0 02-26-2005 08:01 AM
dns requests from localhost to localhost keex Linux - Networking 2 11-13-2003 01:47 PM
Telnet localhost and telnet not from localhost for IMAP services seb77 Linux - Networking 1 10-15-2003 01:20 PM

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

All times are GMT -5. The time now is 07:08 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
Open Source Consulting | Domain Registration