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
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息