简体   繁体   English

Cherrypy在Apache Windows后面运行

[英]Cherrypy running behind Apache windows

I'm trying to run my python application behind apache, to make it accessible from the internet. 我正在尝试在apache后面运行我的python应用程序,以使其可从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. 我已经安装了Apache 2,据我所知,配置不多,真的不知道从哪里开始。

Here is the conf file of my python script: 这是我的python脚本的conf文件:

[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> . 您可以在httpd.conf文件中使用ProxyPass指令将所有请求以虚拟名称转发到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. 确保您还阅读了Apache的文档。 You will need to enable mod_proxy for that. 您将需要为此启用mod_proxy。 Other options are the URL rewriting engine of Apache, for which you will need complex regular expressions! 其他选项是Apache的URL重写引擎,为此您将需要复杂的正则表达式!

EDIT: Here the YOUR.SERVER.com is any server which is running your cherrypy site. 编辑:这里YOUR.SERVER.com是运行您的cherrypy网站的任何服务器。 It should be accessible from the server where apache is running (localhost in case it is the same server). 应该可以从运行apache的服务器(如果是同一服务器,则为localhost)对其进行访问。 Call it my.apace.com for example. 例如,将其命名为my.apace.com。 For accessing the cherrypy site, you can simply say http://my.apache.com/myCherryPySite 要访问cherrypy网站,您只需说一下http://my.apache.com/myCherryPySite

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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