Can't ping myself


I have a strange problem I can't ping localhost or not even as root.
I get 100% packet loss. My Apache server does work sometimes but most of the times it just comes up with error 404. I guess that's because localhost doesn't work.

I have an internet connection through a network and that seems to work fine, it's just that I want to use my own apache. I followed some instructions on how to enable PHP and MySQL on the Apache. So I enabled the root account and configured first MySQL then an Apache and at last the PHP Module. Before that everything worked fine.

One strange thing is that other people can ping me. But they can't connect to my Apache since I cannot start it correctly. Have any ideas?


in linux there is a file named httpd.conf, this file can be found in the /conf dir in your apache dir. check this file for strange this, also add a line to tell apache to load php (read the php manual for the exact syntax).

for the ping problem, check your routing table, maybe there is something wrong in it.



Excuse me but what is the routing table. I'm kinda new to unix is that a file to edit?

I think that the ping problem causes the apache to not work. Since it works sometimes I have checked both PHP and MySQL with apache and it seem to work fine. I can retrieve data from a dB and display it with PHP on a webpage on my server. But most of the time Apache doesn't work.

Could an installation of apache cause problems with pinging itself?


a routing table tells an ip packet which way to travel. a rounting table is build with entries/rules. if an entrie/rule match with the destination of an ip packet, then there is a port listed in the entrie/rule where that ip packet have to go. if your routing table is wrong, then ip packets will travel the wrong way, and there is a chance your ip packet will never reach his destination.

another thing that can cause your ping problem is that your firewall (if u have 1) block the ping request, or that the ping deamon is not started. atm i don't know how to start the ping deamon (or what name it has)


Being unable to ping localhost is really strange. What are the output from these commands (run from Terminal)?

ifconfig lo0

netstat -rn

The first checks the interface for, it should look like:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet netmask 0xff000000

The second prints out the aforementioned routing table; it should have, among other entries, one like:

Destination Gateway Flags Refs Use Netif Expire UH 10 40647 lo0

Does anything look definitely different?


Sorry if this is way off--but did you install a second Apache server or modify the one that is currently running?

If you installed a second Apache things might be a little messed up.

First turn off Apache in the Apple Sharing System Pref Panel. Then from a terminal window type "top", if you see any lines that have "httpd" you may be running two instances of Apache. When you are done viewing top just hit the "q" key. You can also use the Mac OSX gui ProcessViewer under /Applications/Utilities to see processes also--just be sure to select show: All Processes. If httpd is still running you should stop it using the apachectl from the bin directory of the second Apache server.

To check your routing configuration use NetInfo Manager (in /Applications/Utitlities). In the window choose "machines" then "localhost". In the bottom window there should be the following properties and values

name localhost
serves ./local

To change these you will need to de-activate the little security lock and enter your admin password. Then you can double click and modify each field. When you are done quit Netinfo to save your changes.

That's all I can think of for now.



The problem is solved now, thanks for all the help. I configured and compiled a new Apache. Changed httpd.conf ServerName variable to localhost and after that I did't get any alerts. The ping was resolved after a restart it wasn't enough to login/logout I'm sorry bothering you.