1

The Chrome alert me

Oops! Google Chrome could not connect to localhost

But my apache still running:

  501 80299 71841   0  2:35PM ttys003    0:00.00 grep httpd

I paste some piece of important apache configuration , please help me. Thanks.

http.conf

ServerRoot "/usr" Listen 80

ServerAdmin you@example.com

DocumentRoot "/Users/username/Sites"

<Directory />   Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride None
    Order deny,allow
    Allow from all </Directory>

<Directory "/Library/WebServer/Documents">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all 
</Directory>

Actually I don't know what file I need to show you.

If you need more configuration file detail, please tell me. I will paste later.

  • Let us help you by having a read at the tour and help center and explaining 1. how you started apache or installed it in the first place. 2. Where you are stuck precisely. Out of the box, no mac can connect to localhost in Chrome (or any other browser for that matter) so it's hard for us to guess what you have set up here. – bmike Dec 28 '13 at 18:10
  • @bmike, I update my question, Please unhold my question, Thanks – TangMonk Dec 29 '13 at 4:55
  • Apache comes with the base OS X and there really isn't a way to uninstall. What actually are you tying to do? – bmike Dec 29 '13 at 4:59
  • @bmike, No, I just want to make my apache come back. I modify some configuration, but now I can not visit localhost. I update my question again, please help me. – TangMonk Dec 29 '13 at 6:18
  • 3
    That ps output doesn't show apache running, it shows grep running (and searching for httpd). You may just need to start it; see instructions in this superuser answer. – Gordon Davisson Dec 29 '13 at 7:12
2

Run this command:

sudo apachectl start

That should start your standard apache server software as well as edit the system startup files to cause it to start at boot. Replace start with stop to reverse that change. Your grep shows that httpd is not actually running and there's just the grep process active. You may need to look at the logs if after asking apachectl to start things up, the httpd process doesn't stay running (or even start in the first place).

You must log in to answer this question.

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