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.

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.

share|improve this question
    
Have you checked to see if port 80 or whatever port that MAMP uses for apache is available? Also check your loopback network interface. –  Sandeep Bansal Sep 9 '11 at 12:05
    
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 W Sep 9 '11 at 13:52
1  
Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host –  Jack W Sep 9 '11 at 13:52

3 Answers 3

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|improve this answer
    
apachectl configtest returns 'Syntax OK', but just running apachectl outputs the following: –  Jack W Sep 9 '11 at 13:48
    
(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 –  Jack W Sep 9 '11 at 13:48
    
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. –  RedGrittyBrick Sep 9 '11 at 15:09
    
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 –  Sandeep Bansal Sep 9 '11 at 15:28
    
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. –  d34dh0r53 Dec 17 '11 at 5:23

I just ran into this same issue and solved it by changing my Listen port arbitrarily.

I had the same error that you had, except that I was using a custom >1024 port in the first place. After changing my choice, Apache also started to write to its error log, which it refused to do apart from the similar

[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

message. In addition, even though netstat did not show that my port had been busy, Apache was taking quite some time to respond, commonly indicating a socket contention.

share|improve this answer

In /usr/lib there is a file libpq.5.3.dylib while Apache looks for libpq.5.dylib after I copied the file and named it libpq.5.dylib it worked.

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.