Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

brooker

macrumors regular
Original poster
Apr 4, 2007
140
0
PacNW
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!
 
HTTP requests but Apache is dead...oy.

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!
 
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!

a little over my head, but maybe use a port scanner? that should tell you surely?
 
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!
I believe that incoming http connections still come over port 80.
 
I believe that incoming http connections still come over port 80.

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

run http://www.obdev.at/products/littlesnitch/index.html
and then try the telnet thing.. see if it tells you what it's using..

the demo should give you enough time to try that..
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...
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.