In the Terminal window, I started the web server with sudo apachect1 start, supplied the password and then got:

/System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded

Then, in the Safari Smart Search field I entered:


Then I got:

enter image description here

In Terminal https -v is reported:

Server version: Apache/2.4.16 (Unix) Server built: Jul 31 2015 15:53:26

How can we fix this please? Thanks.

  • What's the output of lsof -n -i | grep LISTEN?
    – bot47
    Commented Jan 9, 2016 at 10:13
  • does not give any output. only back to the prompt.
    – Fred J.
    Commented Jan 9, 2016 at 10:32
  • Do you have the built-in firewall enabled?
    – bot47
    Commented Jan 9, 2016 at 10:33
  • System Preferences >Security & Privacy > Firewall is off
    – Fred J.
    Commented Jan 9, 2016 at 10:37
  • ps -e | grep http ?
    – bot47
    Commented Jan 9, 2016 at 10:40

4 Answers 4


Turns out that there is evidence that upgrading from Snow Leopard to El Capitan upgrades the apache2 binaries, but not its configuration. Please get the original apache2 config from a El Capitan clean-install and replace yours with it. It's located at /private/etc/apache2/original. Replace your httpd.conf and the folder extra with those you got from the clean install. Restart apache2 afterwards.



apachectl configtest

into your command line and see what errors you get...

  • Welcome to Ask Different! We're looking for answers that provide explanations as to why it answers the question as well as why it's the best answer. See How to Answer for info on what makes up a good answer. - From Review -
    – fsb
    Commented Jul 5, 2016 at 14:17
  • @fsb - this is a good answer. This helped me solve my issue as to why localhost wasn't running. Of course you should check for syntax errors in your config file.
    – AlxVallejo
    Commented Dec 30, 2016 at 14:06
  • @AlxVallejo I'm glad the answer worked for you. I didn't say the answer was good or bad. This site prefers answers that can 'stand alone' and be as complete as possible (see the link I posted). To meet that goal, this answer, for instance, should explain what that command would do and how entering that command will address the OP's issue.
    – fsb
    Commented Dec 30, 2016 at 15:13

In order to efficiently solve the apache problem. We need to open a hidden file which is not available. This is the private file.

Go to your browser Google Chrome or safari and in the address bar place.


there you will see the apache files within the apache2 folder. In order to alter this, you must go to Terminal and type:

open /private/etc

this accesses the private file. You will see a folder named etc within this its apache2 open it, go to original folder copy paste the 2 files extra and httpd.conf into a new folder on desktop name it what you want we don't care, take the two files extra and httpd.conf place them into the apache2 overwriting the existing files is necessary and the localhost should say It works!

  • How does this differ from the other answer?
    – mmmmmm
    Commented Apr 4, 2016 at 16:12

Getting the following errors:

AH00557: httpd: apr_sockaddr_info_get() failed for iMac.local

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message

Could be because you are trying to access localhost via https rather than http. Change it to http and see if that resolves the issue.

You must log in to answer this question.

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