Apache attempting to restart every 10 sec, error_log growing

Discussion in 'iPod touch' started by coax, Oct 16, 2007.

  1. coax

    coax New Member

    Joined:
    Oct 11, 2007
    Messages:
    20
    Likes Received:
    0
    Device:
    iPod touch
    First of all Apache runs fine, but I noticed this in the Apache error log:

    [Tue Oct 16 15:23:46 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
    [Tue Oct 16 15:23:56 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
    [Tue Oct 16 15:24:06 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80

    and so on... every 10 seconds.

    # ps aux | grep httpd
    root 29 0.0 0.0 273552 512 ?? Ss 2:59PM 0:00.38 /usr/libexec/httpd
    nobody 394 0.0 0.0 273552 608 ?? S 3:13PM 0:00.11 /usr/libexec/httpd
    root 649 0.0 0.0 274156 292 p0 R+ 3:26PM 0:00.01 grep httpd

    Tryed playing around with the httpd.conf and /System/Library/LaunchDaemons/org.apache.httpd.plist but haven't found a solution.

    Not a huge deal, but I can see needing to disable logging as it's grown to 200k in just a few hours.
  2. Andy Huang

    Andy Huang Retired Moderator

    Joined:
    Oct 5, 2007
    Messages:
    968
    Likes Received:
    5
    Device:
    iPhone 4 (Black)
    looks like you already have httpd running on port 80. Either kill those, or change apache to another port... perhaps you have lighttpd or apache installed via installer already?
  3. coax

    coax New Member

    Joined:
    Oct 11, 2007
    Messages:
    20
    Likes Received:
    0
    Device:
    iPod touch
    To clarify, yes, I do have Apache from Installer.app installed and running. The problem is that, for some reason, maybe it's launchd, I don't know; but something is causing httpd to try to start a new instance every 10 seconds.

    I also discovered that commenting out the *Log lines in httpd.conf still adds the above lines to error_log, so for now I've done an "ln -s /dev/null error_log" to keep the drive from filling up (35kB/hour).

    Edit: As an expiriment, changed httpd.conf to Listen on port 81. I can connect through Safari and now the 10 second error is:
    [Tue Oct 16 16:29:30 2007] [crit] (48)Address already in use: make_sock: could not bind to port 81
    [Tue Oct 16 16:29:40 2007] [crit] (48)Address already in use: make_sock: could not bind to port 81
  4. Andy Huang

    Andy Huang Retired Moderator

    Joined:
    Oct 5, 2007
    Messages:
    968
    Likes Received:
    5
    Device:
    iPhone 4 (Black)
    Hm... I guess osmething is triggering it to run, twice. So one is running properly, and another one is constantly trying to restart itself because it cannot bind to port 80... Unfortunately, I didn't install apache, and not expert enough, so I cannot tell you where to verify... I vaguely recall there is a directory some where that tells your iPod to run something on start up, please search the forum and see if you can find an extra instance of httpd there...
  5. coax

    coax New Member

    Joined:
    Oct 11, 2007
    Messages:
    20
    Likes Received:
    0
    Device:
    iPod touch
    Turns out launchd is the culprit, if you do:

    cd /System/Library/LaunchDaemons
    launchctl unload org.apache.httpd.plist

    the messages stop.

    Is anyone running Apache (I'm using 1.3.37-2) who's NOT seeing this error (look in /var/log/httpd/error_log)? If so could you post your /System/Library/LaunchDaemons/org.apache.httpd.plist file.
  6. Illsley

    Illsley New Member

    Joined:
    Nov 4, 2007
    Messages:
    38
    Likes Received:
    0
    Hey

    I just installed Apache with php and my server works but php doesnt seem to work, i get a clean white page when trying to access my Index.php.

    ANyway.. here are my errors in the log file.
    It keeps trying all the time as you say...

    [Wed Nov 21 19:35:24 2007] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    [Wed Nov 21 19:35:24 2007] [notice] Apache/1.3.37 (Darwin) configured -- resuming normal operations
    [Wed Nov 21 19:35:24 2007] [notice] Accept mutex: flock (Default: flock)
    [Wed Nov 21 19:35:34 2007] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    [Wed Nov 21 19:35:34 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
    [Wed Nov 21 19:35:44 2007] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    [Wed Nov 21 19:35:44 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
    [Wed Nov 21 19:35:54 2007] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    [Wed Nov 21 19:35:54 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
    [Wed Nov 21 19:36:04 2007] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    [Wed Nov 21 19:36:04 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
  7. nCognito

    nCognito New Member

    Joined:
    Oct 26, 2007
    Messages:
    24
    Likes Received:
    0
    I also get the "Address already in use: make_sock: could not bind to address"
    Did anyone found a solution to this problem in the meantime?

    thanks
  8. inatightspot

    inatightspot New Member

    Joined:
    Nov 24, 2007
    Messages:
    173
    Likes Received:
    2
    Can't see my /var/log/httpd/error_log in iphonebrowser but it's 25MB large. Is that a problem?

Share This Page