ubuntu+web.py+fastcgi+lighttpd

  1. 配置web.py 不需修改
  2. 配置lighttpd
#2.1)加载mod_fastcgi
    server.modules = (
        ...
        "mod_fastcgi",
        ...
    )

    #2.2)路径
    server.document-root = "/home/edc/Documents/myAppPath"

    #2.3)并发性加强
    server.max_fds = 4096
    server.max_connections = 1024

    fastcgi.server = ("myapp.py" => 
        (
            "p0"=>(
            "host"=>"127.0.0.1",
            "port"=>3721,
            "max-procs"=>1000,
            "bin-environment"=>("REAL_SCRIPT_NAME"=>""),
            "check-local"=>"disable" #enable|disable
            )
        ) 
    )

    url.rewrite-once=(
        "^/static/(.*)$" => "/static/$1",
        "^/(.*)$"=>"/myapp.py/$1",
    )
  1. 启动myapp.py
python myapp.py 3721 fcgi&
  1. 启动lighttpd
sudo /etc/init.d/lighttpd restart 
 sudo service lighttpd reload
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息