Apache won't start on Mac OS X Lion/MAMP

13,470

If MAMP provides the usual apachectl, I'd use that to test the configuration apachectl configtest.


Update:

To find out what program is already using (i.e. listening or bound to) port 80 use netstat -anp as root.

Update 2:

Note that you need to be root to bind to privileged port numbers (below 1024)

Share:
13,470

Related videos on Youtube

Jack
Author by

Jack

Updated on September 18, 2022

Comments

  • Jack
    Jack over 1 year

    I'm having a hard time getting Apache to start running via MAMP.

    I've been developing with MAMP for the past few months and all has worked fine. This morning, however, Apache has magically stopped working, despite me making no alterations to the configuration or anything.

    Checking my apache_error.log I see this every time I try to start Apache via MAMP:

    [Fri Sep 09 12:16:19 2011] [alert] (EAI 8)nodename nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "unknown040cced5b2fe"
    Configuration Failed
    

    Any ideas? I'm a bit stumped.

    • Sandeep Bansal
      Sandeep Bansal over 12 years
      Have you checked to see if port 80 or whatever port that MAMP uses for apache is available? Also check your loopback network interface.
    • Jack
      Jack over 12 years
      I'm not so sure how to go about doing that (not quite as expert as most users here!) but I ran telnet 127.0.0.1 80 (as well as 8080 and 8888) and each time got the following:
    • Jack
      Jack over 12 years
      Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host
  • Jack
    Jack over 12 years
    apachectl configtest returns 'Syntax OK', but just running apachectl outputs the following:
  • Jack
    Jack over 12 years
    (13)Permission denied: make_sock: could not bind to address [::]:80 (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs
  • user5249203
    user5249203 over 12 years
    Then Sandeep is correct, some other application is already listening on port 80. Find out what it is (netstat -anp as root) and stop it.
  • Sandeep Bansal
    Sandeep Bansal over 12 years
    My first thought would be Skype, check to see if Skype is running, it normally binds to port 80. Also your IP should be 127.0.0.1 instead of 0.0.0.0
  • revetinja
    revetinja over 12 years
    Not 100% sure, so I'm not posting this as an answer, but you probably are not starting Apache as root and you need to have root privileges (at least initially) in order to listen on port 80. I found this forum post forum.mamp.info/viewtopic.php?t=372 which seems to corroborate my theory but I have not tested it out so YMMV.