`
bobning
  • 浏览: 60830 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

django + lighttpd + fastcgi 配置

阅读更多
都说lighttpd并发高,于是心里痒痒,打算配个来玩玩,结果细节问题搞的我头痛。
lighttpd的主要配置如下:
server.modules              = ( 
            "mod_rewrite", 
            "mod_alias",
            "mod_access",
            "mod_status",
            "mod_fastcgi",
            "mod_accesslog",
 )
$HTTP["remoteip"] == "192.168.1.41" {
   server.document-root = "/home/bob/projects/repos/trunk/histool/cqip/client"
	fastcgi.server = (
	    "/cqip.fcgi" => (
	        "main" => (
	            "host" => "192.168.1.41",
	            "port" => 8888,
	            "check-local" => "disable"
	        )
	    ),
	)
	alias.url += (
		"/site_media/" => "/home/bob/projects/repos/trunk/histool/cqip/client/media/",
        "/media/" => "/home/bob/projects/django_src/django/contrib/admin/media/"
	)
	url.rewrite-once = (
	    "^(/media.*)$" => "$1",
	    "^/favicon\.ico$" => "/media/favicon.ico",
	    "^(/.*)$" => "/cqip.fcgi$1",
	)
}

配置好后启动lighttpd:
$sudo /etc/init.d/lighttpd restart
再启动flup:
$python manage.py runfcgi method=threaded host=192.168.1.41 port=8888
这样基本就ok拉,但是....  当访问数据库时候提示 can not open database file错误,我的数据库是sqlite的。就这个问题我一时没转过弯来,因为使用django自带的服务是没有问题的,所以没有想到是settings中数据库路径设置问题。还以为是权限问题呢。结果把路径设置为绝对的就ok拉。
分享到:
评论
3 楼 范三山 2009-01-28  
我靠,我在别的博客看见一个一样的文章。究竟哪个是抄的?
2 楼 bobning 2008-07-08  
1. http://192.168.1.41/   是我django项目跑的ip, 我的lighttpd和flup都在41上
2. /cqip.fcgi   cqip是我的django项目, 你可以随便取名的。
1 楼 rawbenny 2008-07-05  
Good artical.

I have questions about the configuration items..

1) In this case, what url do i use to visit this application?
is this http://192.168.1.41/  right?

2) what is this mean "/cqip.fcgi"  ?

Thanks.

相关推荐

Global site tag (gtag.js) - Google Analytics