Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in snow leapord machine http://localhost/ isn't working through browser. But when I ping http://localhost/ I do get successful replies

PING localhost ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.050 ms
64 bytes from icmp_seq=1 ttl=64 time=0.151 ms
64 bytes from icmp_seq=2 ttl=64 time=0.101 ms
64 bytes from icmp_seq=3 ttl=64 time=0.100 ms
64 bytes from icmp_seq=4 ttl=64 time=0.095 ms

Error log show something like below

(2)No such file or directory: httpd: could not open error log file /usr/\xe2\x80\x9c/private/var/log/apache2/phpMyAdmin.localhost-error_log\xe2\x80\x9d. Unable to open logs

what might be wrong?

share|improve this question
What happens if you do – imtheman Jul 6 '12 at 17:45
same not working – Bhushan Jul 6 '12 at 17:46
What error message do you get in the browser? – Chris Herbert Jul 6 '12 at 17:47
Oops! Google Chrome could not connect to localhost – Bhushan Jul 6 '12 at 17:47
Silly question: is apache2 started and listening on port 80? – Jeff F. Jul 6 '12 at 17:48
up vote 4 down vote accepted

Try running the following command:

netstat -an -p tcp | grep 80 | grep LISTEN

you should get a line like this one :

tcp4       0      0  *.80                   *.*                    LISTEN

If you don't, your server is not started, whatever the reason is.

If you are trying to access is your Web sharing, check the System settings -> Sharing -> Personal Web Sharing is active.

share|improve this answer
I can't see anything. how do I fix this? – Bhushan Jul 6 '12 at 18:18
What do you expect to find when you access localhost ? Did you check that "Personal web sharing" is active ? – Julien Ch. Jul 6 '12 at 18:23
yes it is active. I expect to see It Works message. Actually I am trying to setup phpmuadmin – Bhushan Jul 6 '12 at 18:30
From your error string i woulg guess that you weongly copied and pasted left and right quotation marks ( like “,” or «,») when setting up phpmyadmin. Did you check that? – Julien Ch. Jul 6 '12 at 18:51
well that helped.. thanks – Bhushan Jul 6 '12 at 19:18

The error log reveals that \xe2\x80\x9c appears twice in the path. That means that you have used rather than " in your path, which will not be interpreted correctly.

Replace them both with " instead and you should be good to go!

share|improve this answer

Successful pinging indicates the target machine is online (and has ICMP ping reply on). Clearly it is, since you're pinging your own machine (that's what localhost or is).

Opening http://localhost/ in a browser will only work if there's a web server running on port 80 on the target machine (in this case, localhost, is your own machine). You probably do not have a web server running, do you? If it you do, it must be off or misconfigured.

share|improve this answer
how do I check if web-server is running and if not running how do I start it – Bhushan Jul 6 '12 at 17:50
I tried stoping and restarting web server with apachectl stop and apachectl start command but still not working – Bhushan Jul 6 '12 at 17:53
How to check if a web-server is running depends on the web-server. Which web-server did you install? Did you try following the instructions they've laid out for getting started? – Dmitri Shuralyov Jul 6 '12 at 17:54
the that comes with snow leopard, i guess its apache web server – Bhushan Jul 6 '12 at 17:54

I found these two things were necessary on Snow Leopard:

  1. Make sure that /etc/apache2/httpd.conf has a proper entry for "UserDir" [ grep UserDir /etc/apache2/httpd.conf ]. What I needed was: UserDir Sites [ I assume you know how to use and "sudo" commands.]
  2. If you have your own firewall, make sure is allowed for port 22, such as: "allow tcp from to any dst-port 22 in". I also recommend: "allow tcp from any to any dst-port 80 in".
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .