简体   繁体   中英

Cherrypy running behind Apache windows

I'm trying to run my python application behind apache, to make it accessible from the internet. But I have to say I'm struggling a bit to make the whole thing work. I have Apache 2 installed, not much configured as far as I know, don't really know where to start.

Here is the conf file of my python script:

[global]
server.socket_host= '127.0.0.1'
server.socket_port= 8080
server.thread_pool= 5
tools.sessions.on= True
tools.encode.encoding= 'Utf-8'
[/annexes]
tools.staticdir.on = True
tools.staticdir.dir = "my/path"
[/]
tools.proxy.on: True

You can use the ProxyPass directive in your httpd.conf file to forward all requests at a virtual name to http://YOUR.SERVER.com:8080</code> .

Something like

ProxyPass /myCherryPySite http://YOUR.SERVER.com:8080

Make sure you also go through the documentation of Apache. You will need to enable mod_proxy for that. Other options are the URL rewriting engine of Apache, for which you will need complex regular expressions!

EDIT: Here the YOUR.SERVER.com is any server which is running your cherrypy site. It should be accessible from the server where apache is running (localhost in case it is the same server). Call it my.apace.com for example. For accessing the cherrypy site, you can simply say http://my.apache.com/myCherryPySite

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM