|
最近想尝试一下用 lighttpd 换掉原先的 Apache
下载 lighttpd , 安装后访问不能...
郁闷中...
不知哪位兄弟有成功配置 lighttpd + FastCGI + Python 的经验
请指教!谢谢!
网上查到的例子,实验的时候返回 500, 修改相关权限后 返回 403,晕...
FastCGI配置:
## FastCGI programs have the same functionality as CGI programs,
## but are considerably faster through lower interpreter startup
## time and socketed communication
##
## Documentation: /usr/share/doc/lighttpd-doc/fastcgi.txt.gz
## http://www.lighttpd.net/documentation/fastcgi.html
server.modules += ( "mod_fastcgi" )
## Start a FastCGI server for python test example
fastcgi.debug = 1
fastcgi.server = ( ".fcgi" =>
( "localhost" =>
(
"socket" => "/tmp/fcgi.sock",
"min-procs" => 2
)
)
)
测试脚本:
#!/usr/local/bin/python
from flup.server.fcgi import WSGIServer
def myapp(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!\n']
WSGIServer(myapp, bindAddress = '/tmp/fcgi.sock').run()
请大家指点啊! |
|