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 have a mac-mini (Fall 2009) with OS X 10.8.4 on my local network and I am running a simple http server on port 5000 (or any other port).

I have turned the firewall OFF. I can connect to the mac via ssh and ping it.

I can connect to the http server using

curl 127.0.0.1:5000 
...I get the data...

but if I use the IP that my local router has assigned to this mac, I cannot connect to the port. e.g.:

$ curl -v 192.168.178.26:5000
* About to connect() to 192.168.178.26 port 5000 (#0)
*   Trying 192.168.178.26...
* Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host

This does not work on the local mashine nor form a remote machine.

However this works:

$ ssh 192.168.178.26
Last login: ....

The firewall is off:

$ defaults read /usr/libexec/ApplicationFirewall/com.apple.alf.plist firewallunload
0

and ipfw seems to be OK:

$ sudo ipfw show
65535 0 0 allow ip from any to any

Interestingly, if I run the same http-server on my MacBookPro on the same network, I can connect....

Where can the problem be? And how can I debug it?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Check if your webserver isn't only listening on 127.0.0.1, if so set it to 0.0.0.0 to listen on all interfaces (or your network public address - 192.168.178.26) so that it can be reached from other machines on the network.

share|improve this answer
    
in my case I could have changed the script or set an environment variable export PORT=0.0.0.0 –  Michael_Scharf Jun 18 '13 at 2:14
add comment

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.