webpy的LightTPD配置,webpyLightTPD配置,在生产环境下推荐在Lig
webpy的LightTPD配置,webpyLightTPD配置,在生产环境下推荐在Lig
在生产环境下推荐在Lighttpd中以FastCGI形式运行webpy,reddit.com使用这种方式处理日Pv量达到百万。
lighttpd的配置文件如下
server.modules = ("mod_fastcgi", "mod_rewrite") server.document-root = "/path/to/root/" fastcgi.server = ( "/code.py" => (( "socket" => "/tmp/fastcgi.socket", "bin-path" => "/path/to/root/code.py", "max-procs" => 1 )) ) url.rewrite-once = ( "^/favicon.ico$" => "/static/favicon.ico", "^/static/(.*)$" => "/static/$1", "^/(.*)$" => "/code.py/$1" )
在有些版本的lighttpd中需要确认将fastcgi.server的check-local属性设置为false,特别是当你的code.py没有在网站的根目录下时。
如果您看到“不能导入flup”的错误消息,这说明你需要装下flup,使用easy_install flup
命令即可。
从版本145开始,如果你的代码中使用了跳转就需要修改fastcgi配置bin-environment变量。如下示例配置
fastcgi.server = ( "/code.py" =>(( "socket" => "/tmp/fastcgi.socket", "bin-path" => "/path/to/root/code.py", "max-procs" => 1, "bin-environment" => ( "REAL_SCRIPT_NAME" => "" ), "check-local" => "disable")))
翻译自: http://webpy.org/install#lighttpdfastcgi
相关内容
- webpy 性能调优记录页面执行时间,webpy调优,记录网站执
- python使用urllib2上传文件代码,pythonurllib2,import urlli
- python中文字符编码decode,encode以及乱码解决总结,pyt
- 在python中使用windows内存映射文件,pythonwindows,在python中
- python使用json序列化datetime类型问题处理,jsondatetime,使用
- 使用urlparse.urlparse()解析url,,python中使用url
- python使用memcached做缓存,pythonmemcached,在python中使用me
- python使用SGMLParser提取文本正文内容,pythonsgmlparser,如下
- Python thread socket server,pythonsocket,从网上参考了一些代码
- python list使用技巧总结,pythonlist使用技巧,判断一个 l
评论关闭