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拉。

你可能感兴趣的:(lighttpd,Django,Python,SQLite,Access)