- 配置web.py 不需修改
- 配置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",
)
- 啓動myapp.py
python myapp.py 3721 fcgi&
- 啓動lighttpd
sudo /etc/init.d/lighttpd restart
sudo service lighttpd reload