Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.050 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.151 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.101 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.100 ms
64 bytes from 127.0.0.1: 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 http://127.0.0.1/? –  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
1  
Oops! Google Chrome could not connect to localhost –  Bhushan Jul 6 '12 at 17:47
1  
Silly question: is apache2 started and listening on port 80? –  Jeff F. Jul 6 '12 at 17:48

3 Answers 3

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

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 127.0.0.1 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 Terminal.app and "sudo" commands.]
  2. If you have your own firewall, make sure 127.0.0.1 is allowed for port 22, such as: "allow tcp from 127.0.0.1 to any dst-port 22 in". I also recommend: "allow tcp from any to any dst-port 80 in".
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.