#!/usr/bin/python
import cherrypy
cherrypy.config.update({'server.socket_host': "10.0.1.15",'server.socket_port': 80})
class HelloWorld(object):
def index(self):
return "HelloWorld"
index.exposed = True
cherrypy.quickstart(HelloWorld())
这是我的代码,但我得到
[29/Jan/2014:11:16:14] ENGINE Bus STOPPING
[29/Jan/2014:11:16:14] ENGINE HTTP Server
cherrypy._cpwsgi_server.CPWSGIServer(('10.0.1.15', 80)) already shut down
[29/Jan/2014:11:16:14] ENGINE Stopped thread '_TimeoutMonitor'.
[29/Jan/2014:11:16:14] ENGINE Stopped thread 'Autoreloader'.
[29/Jan/2014:11:16:14] ENGINE Bus STOPPED
[29/Jan/2014:11:16:14] ENGINE Bus EXITING
[29/Jan/2014:11:16:14] ENGINE Bus EXITED
我对内部地址10.0.1.15进行了DHCP预留,并且在我的机场极端设置中也为地址打开了端口80.