我刚接触FastCGI和lighttpd, 正在尝试设置我的DJANGO应用程序时,遇到了一些问题:
CSS根本不起作用
FastCGI为请求的URL添加了前缀,即
mydomain.com/mysite.fcgi/mysite.fcgi/content/1/000228/ 而不是
mydomain.com/content/1/000228/
下面是我在conf-enabled文件夹中的FastCGI脚本(10-fastcgi.conf):
# /usr/share/doc/lighttpd-doc/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_
# fastcgi-fastcgi
server.modules += ( "mod_fastcgi" )
fastcgi.server = (
"/" => (
"main" => (
"socket" => "/tmp/mysite.sock",
"check-local" => "disable",
)
),
)
alias.url = (
"/media" => "/home/path/to/my/media",
)
url.rewrite-once = (
"(/media.*)$" => "$1",
"^/favicon\.ico$" => "/media/favicon.ico",
"^(/.*)$" => "/mysite.fcgi$1",
)
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png",
".css" => "text/css"
)
以下是我的lighttpd.conf配置:
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite",)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
include "/etc/lighttpd/conf-enabled/10-fastcgi.conf"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
" index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/x-javascript", "text/css", "text/html",
"text/plain" )
有什么想法吗?