I'm running a website on my local Mac (Lion) machine using Python's SimpleHTTPServer. I can view the site at http://localhost:8000 or on my local machine.

My question is: why can't I view it on other machines connected to the same LAN?

I have taken the following steps:

  1. Enabled Web Sharing on my Mac, and temporarily turned off my firewall.
  2. Obtained my Mac's IP address via ifconfig: it is
  3. Connected another machine to the same LAN.
  4. On that machine, pointed a browser at

But it doesn't work. I don't even get an HTTP response code: Chrome tells me the response is empty.

  • on your other machine, what does ping give? – MattDMo Jun 17 '13 at 17:39

Without knowing too much about Mac, if it's anything like Linux it'll be because your server is only listening on the ‘loopback’ interface (lo), which always has the IPv4 addr (and the IPv6 addr ::1), and the domain localhost.

This allows you to run a server on your local machine without it being accessible to any of the networks you are connected to. This has security benefits for certain use-cases.

However, you want it to be accessible from your LAN, so you will need to make sure that your Python script is listening on the interface that has IPv4 addr of in your case.

Turning off firewall and other extra steps may be needed. Once you have it working, you may want to see if it works with the firewall turned back on. If not, you may need to add an exception to your firewall configuration.

  • This (+1). And try netstat -a | grep LISTEN to see what's listening where, make sure it's listening on an interface accessible from others on the network. – Rich Homolka Jun 17 '13 at 18:20
  • Thank you! This is excellent advice. Actually, I realised I was running the site on Django's runserver, and this solved my problem: stackoverflow.com/questions/2260727/… – Richard Jun 17 '13 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.