1

enter image description here
In the above picture is my console output which occurs when I run

sudo /usr/sbin/apachectl restart

the console doesn't have any messages of syntax errors or anything when I manually start and stop apache. So how do I debug this?

EDIT: list of things using ports

$ sudo lsof -i:80
Password:
COMMAND PID USER   FD   TYPE      DEVICE SIZE/OFF NODE NAME
httpd   734 root    5u  IPv6 0xf..0      0t0  TCP *:http (LISTEN)
httpd   736 _www    5u  IPv6 0xf..0      0t0  TCP *:http (LISTEN)
httpd   774 root    4u  IPv4 0xf..0      0t0  TCP *:http (LISTEN)
httpd   777 _www    4u  IPv4 0xf..0      0t0  TCP *:http (LISTEN)
httpd   822 _www    4u  IPv4 0xf..0      0t0  TCP *:http (LISTEN)

it's the exact some for -i:443, too. Why are there so many httpds? shouldn't there just be the one? (for each IP version, i guess)

when browsing to my server's IP address in (Your favorite web browser), It just says Internal Server Error.

And then the console on the server says "nstat_lookup_entry failed 2" =\

2 Answers 2

0

Obviously another program is already running on your MAC. Best guess would be Skype if you do not have any other server installed. It used to use those two ports.

Maybe easier - try this at the terminal as well to see what is listening:

sudo lsof -n -i4TCP:80 | grep LISTEN
6
  • I'll add some more info. This is a brand new computer. Skype's not even gonna be on it =p Dec 7, 2011 at 22:05
  • added some more info, to assist you in finding the process listening on port 80. replace 80 with 443 to check that port. Hope that helps
    – Chris
    Dec 7, 2011 at 22:07
  • it's teh same list =\ same with 443. Dec 7, 2011 at 22:09
  • I just noticed something, though when I go to my server's IP address, the server's console says "nstat_lookup_entry failed 2" Dec 7, 2011 at 22:10
  • try whereis httpd to find the binary location. There is already an apache running on your mac. If it is yours you should try a stop/start instead of the restart
    – Chris
    Dec 7, 2011 at 22:13
0

From your screenshot it seems the failing operation is trying to bind to the IPv6 equivalent of 0.0.0.0, i.e. [::]. It also seems that binding to the IPv4 "address" 0.0.0.0 succeeds. So after starting your Rails app check the output of netstat -64tulpen (or the appropriate equivalent on OS X) and see if it really isn't listening on the desired ports. Also try to find out what is using IPv6, bound to [::]:80 and [::]:443, and why.

2
  • what does -64tulpen do? my netstat says 6 isn't a valid option. o.o Dec 7, 2011 at 22:19
  • The option -6 makes netstat show IPv6 addresses, on recent Linux distributions at least.
    – daff
    Dec 7, 2011 at 23:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .