Local python web server problem

Gerhard Häring gh at ghaering.de
Mon Feb 9 13:20:16 CET 2009


Farsheed Ashouri wrote:
> Hi everyone. I have started to develop a web base software for
> renderfarm managing.
> I run the cherrypy hello world! example and when I visit
> 127.0.0.1:8080
> on firefox, a nice "Hello World" appears. I am on ubuntu and my ip in
> local network is 192.168.100.18
> but when I visit 192.168.100.18, there is another page: "It Works!".
> What is "It Works!"? and when I type 192.168.100.18:8080 in another
> local pc, the page didn't load? [...]

Services like HTTP servers "bind" not only to a port, but to a
combination of IP address and port.

The CherryPy tutorial configuration

http://www.cherrypy.org/browser/trunk/cherrypy/tutorial/tutorial.conf

binds to 127.0.0.1 and 8080. This means the application can only be
accessed from the local machine.

To bind to all network interfaces, (i. e. Ethernet etc., and not just
the loopback device), you can change server.socket_host to "0.0.0.0".

-- Gerhard




More information about the Python-list mailing list