what the heck is running on port 80?

Discussion in 'macOS' started by brooker, May 17, 2007.

  1. brooker macrumors regular

    Joined:
    Apr 4, 2007
    Location:
    PacNW
    #1
    I'm trying to get a pretty fresh install of OSX server running, but apache won't start. It has an error in the logs:

    Code:
    make_sock: could not bind to port 80
    and it looks like SOMETHING is running on port 80, but there is no process name:

    Code:
    web: root# sudo netstat -an | grep LIST | grep 80
    tcp4       0      0  *.80                   *.*                    LISTEN
    There are not other apache processes running:

    Code:
    web: root# ps -aux | grep httpd
    root     19958   0.0 -0.0    27368    448  p4  S+    3:49PM   0:00.00 grep httpd
    
    web: root# killall httpd
    No matching processes were found
    And yet i still get errors when trying to start it up:

    Code:
    Processing config directory: /private/etc/httpd/users/*.conf
    [Thu May 17 15:50:56 2007] [crit] (48)Address already in use: make_sock: could not bind to port 80
    because something is actually running on port 80:

    Code:
    web: root# telnet localhost 80
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    When i try to get the version number, it dies:
    Code:
    HEAD / HTTP 1.0
    
    Connection closed by foreign host.
    so i don't think it is apache. but i have no idea what else it may be.

    Any thoughts about what is going on? All ideas appreciated!
     
  2. Eidorian macrumors Penryn

    Eidorian

    Joined:
    Mar 23, 2005
    Location:
    Indianapolis
  3. yagran macrumors 6502a

    Joined:
    Jan 8, 2007
    Location:
    Brighton, East Sussex, UK
    #3
    is there anything you say that i dont agree with? YOU STOLE MY BRAIN :p
     
  4. brooker thread starter macrumors regular

    Joined:
    Apr 4, 2007
    Location:
    PacNW
    #4
    right, but... if i edit httpd.conf to say:

    Code:
    LISTEN 8000
    the otherwise-default install of apache starts right up, and i can access everything (just over port 8000 of course).

    So what could be happening on port 80, and what can i do to stop it???

    Thanks for the reply!
     
  5. yagran macrumors 6502a

    Joined:
    Jan 8, 2007
    Location:
    Brighton, East Sussex, UK
    #5
    a little over my head, but maybe use a port scanner? that should tell you surely?
     
  6. Eidorian macrumors Penryn

    Eidorian

    Joined:
    Mar 23, 2005
    Location:
    Indianapolis
    #6
    I believe that incoming http connections still come over port 80.
     
  7. Mr.Texor macrumors regular

    Joined:
    Apr 20, 2007
    #7
  8. brooker thread starter macrumors regular

    Joined:
    Apr 4, 2007
    Location:
    PacNW
    #8
    Correct. But some service other than apache seems to be listening for those connections, and it is keeping apache from starting normally (i.e. without running apache on another port).

    Little Snitch won't help, since this is a local service waiting for incoming connections as Eidorian says. Let's see what Utilities > Network Utility > Port Scan reveals:

    Code:
    Port Scanning host: 127.0.0.1
    
    	 Open TCP Port: 	21
    	 Open TCP Port: 	22		pcanywherestat
    	 Open TCP Port: 	25
    	 Open TCP Port: 	80
    Port Scan has completed ...
    Hm... it sees something, but doesn't ID the service. I will see if i can find a more thurough port scanner.

    Thanks everyone for the assistance. Any other ideas? i'm a little mystified...
     
  9. srf4real macrumors 68030

    srf4real

    Joined:
    Jul 25, 2006
    Location:
    paradise beach FL
  10. brooker thread starter macrumors regular

    Joined:
    Apr 4, 2007
    Location:
    PacNW
    #10
    lsof to te rescue!

    I think i got it figured out. Based on a friendly post on another forum, I get this:

    Code:
    web:~ brooker$ sudo lsof -i :80
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    webperfca 387 www 3u IPv4 0xaabb920 0t0 TCP *:http (LISTEN)
    ...
    Web Performancee Caching. Somehow it was starting before apache, and grabbing port 80. I still need to figure out why this is happening, but killing the process and starting apache right away (before webperfca can restart) seems to get me up and running.

    Anyone know how webperfca is supposed to work? there isn't a lot of info on the web.

    Thanks again for the replies.
     
  11. fall3n macrumors 6502

    Joined:
    Aug 17, 2006
    #11
    I've had this problem before as well. Quite annoying to say the least. I tried to figure it out and kill the process but never could, obviously you have :) well done. My solution was to use a sudo command to start running apache. Worked on my machine, though I'm sure it's not the best solution.
     

Share This Page