昨天没有把Apaache2的fcgid搞定,今天试了试lighttpd + fastcgi +python
参考了蛮多的教程,小小总结一下
1.安装lighttpd 网上很多教程,不重复了
2.修改lighttpd.conf,主要改下面的
fastcgi.server = ( ".py" =>
(( "socket" => "/tmp/fastcgi.socket",
"bin-path" => "/Applications/xampp/xamppfiles/fcgi-bin/index.py",
"max-procs" => 10,
"bin-environment" => (
"index.py" => ""
)
))
)
url.rewrite-once = (
"^/favicon.ico$" => "/static/favicon.ico",
"^/static/(.*)$" => "/static/$1",
"^/media/(.*)$" => "/media/$1",
"^/(.*)$" => "/index.py/$1"
)
3.安装python flup
easy_install flup就OK了
4.创建 /Applications/xampp/xamppfiles/fcgi-bin/index.py
#!/usr/bin/env python2.5
try:
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).run()
except Exception, e:
print 'Content-Type: text/plain\r\n\r\n',
print 'Oops...'
print
print 'Trac detected an internal error:'
print
print e
print
5.参考robin的教程写一个启动的脚本
#!/bin/sh
case "$1" in
start)
/usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
;;
stop)
killall lighttpd
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: lighttpd.sh {start|stop|restart}"
;;
esac
exit 0
6.chmod +x lighttpd.sh
7.运行 lighttpd.sh start
8.访问 http://localhost/index.py
显示 Hello World!
安装成功
分享到:
相关推荐
1.修改lighttpd.conf 修改为自己的工作目录 var.server_root = "/home/caoft/lighttpd/lighttpd_websocket_fastcgi/http_server" var.state_dir = "/home/caoft/lighttpd/lighttpd_websocket_fastcgi/http_server"...
NULL 博文链接:https://yeahoo.iteye.com/blog/319066
支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能,而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为...
startLighttp.vbs 为一键启动lighttpd和php-cgi的启动脚本,php使用fastcgi host:port形式 test_cgi.cmd 为测试cgi传参数用(如果发现php程序返回No input file specified.说明server.document-root这个目录配置的有...
如何在ubuntu上实现lighttpd 1、下载mongoose使用mongoose中的example中的websocket_chat,实现websocket 2、websocket_chat源码下载路径 官网:https://cesanta.com 论坛:...
支持FastCGI,CGI,Auth,输出压缩(output compress),URL重写,Alias等重要功能;而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为...
主要内容包括:lighttpd介绍与分析准备工作、lighttpd网络服务主模型、lighttpd数据结构、伸展树、日志系统、文件状态缓存器、配置信息加载、i/o多路复用技术模型、插件链、网络请求服务响应流程、请求响应数据快速...
startLighttp.vbs 为一键启动lighttpd和php-cgi的启动脚本,php使用fastcgi host:port形式 test_cgi.cmd 为测试cgi传参数用(如果发现php程序返回No input file specified.说明server.document-root这个目录配置的有...
lighttpd-1.4.20.tar lighttpd-1.4.20.tar
资源名称:Lighttpd源码分析内容简介: 作为最为优秀的轻量级Web Server之一,Lighttpd有着众多的忠实拥护者和使用者。Lighttpd源码分析就是一本介绍分析Lighttpd源码的初级读本,其主要目标在于:一方面让已经接触...
lighttpd 流程分析工作模式,帮助理解lighttpd
OS: CentOS release 5.5 Lighttpd: 1.4.28 安装 sudo yum install lighttpd.i386 lighttpd-fastcgi.i386 lighttpd-mod_mysql_vhost.i386 运行 检查配置文件 lighttpd -t -f lighttpd.conf 启动lighttpd服务 ...
varnish+lighttpd配置
lighttpd完全学习,适合新手文档参考,ppt文件
最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载
lighttpd轻量级web嵌入式服务器,方便嵌入式平台移植,小巧安全
lighttpd-1.4.26 源码,官方直接下载,学习的好资源。
lighttpd-1.4.20-cmake
lighttpd代码阅读资料 参数的 web服务器
包括lighttpd.conf配置文件以及用于控制web server启动和停止的脚本。