2

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:

http://localhost/

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? – Max Ried Jan 9 '16 at 10:13
  • does not give any output. only back to the prompt. – Fred J. Jan 9 '16 at 10:32
  • Do you have the built-in firewall enabled? – Max Ried Jan 9 '16 at 10:33
  • System Preferences >Security & Privacy > Firewall is off – Fred J. Jan 9 '16 at 10:37
  • ps -e | grep http ? – Max Ried Jan 9 '16 at 10:40
1

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.

1

type

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 Jul 5 '16 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 Dec 30 '16 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 Dec 30 '16 at 15:13
0

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.

file:///private/etc/apache2/

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? – Mark Apr 4 '16 at 16:12
0

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 127.0.0.1. 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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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