OK,在同学的帮助下解决了,是和php冲突的问题
"^(/.*)$" => "/django.fcgi$1",
改为
"^(/cms*)$" => "/django.fcgi$1",
等等就可以了
______________________________________
问题如下,熟悉的请帮忙看看,谢谢
我的配置文件如下,运行lighttpd后查看django.fcgi进程已经启动.
但是访问网页,网站是一直空白页,显示加载中,但什么也没有
"^(/.*)$" => "/django.fcgi$1",
改为
"^(/cms*)$" => "/django.fcgi$1",
等等就可以了
______________________________________
问题如下,熟悉的请帮忙看看,谢谢
我的配置文件如下,运行lighttpd后查看django.fcgi进程已经启动.
但是访问网页,网站是一直空白页,显示加载中,但什么也没有
<wbr></wbr>,日志里面也没有错误.
但是用manage自带的runserver就可以访问.
配置文件和网上的几乎一样,django是svn最新版.
研究了一个下午+一个晚上还是没有解决方案
django.fcgi
______________________________<wbr></wbr>_______________
#!/usr/bin/python
import sys, os
PROJECT_PATH='/home/www/django<wbr></wbr>/website'
#sys.path.insert(0, PROJECT_PATH)
os.chdir(PROJECT_PATH)
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(
method="prefork",
daemonize='false',
socket="/var/run/lighttpd<wbr></wbr>/lighttpd-django.sock",
#host=" 127.0.0.1",
#port=9001,
)
______________________________<wbr></wbr>__________________
/etc/lighttpd/lighttpd.conf
______________________________<wbr></wbr>_________________
var.basedir = "/home/www/"
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
server.modules = (
"mod_rewrite",
"mod_alias",
"mod_access",
"mod_fastcgi",
"mod_accesslog"
)
include "mime-types.conf"
fastcgi.server = (
".php" =>
((
"socket"=>"/var/run/lighttpd<wbr></wbr>/lighttpd-fastcgi-php-" + PID +
".socket",
"bin-path" => "/usr/bin/php-cgi",
<script type="text/javascript"></script> "min-procs" => 8,
"max-procs" => 20,
"idle-timeout" => 20
)),
"/django.fcgi" =>
("main" =>(
#"host" => " 127.0.0.1",
#"port" => 9001,
"check-local" => "disable",
"socket" =>
"/var/run/lighttpd/lighttpd-django.sock",
"bin-path" => var.basedir + "django.fcgi",
))
)
server.username = "stuhome"
server.groupname = "lighttpd"
server.document-root = var.basedir
server.pid-file = "/var/run/lighttpd.pid"
server.errorlog = var.logdir + "/error.log"
server.follow-symlink = "enable"
server.event-handler = "linux-sysepoll"
server.port = 80
static-file.exclude-extensions = (".php", ".pl", ".py", ".cgi", ".fcgi")
alias.url = (
<script type="text/javascript"></script> "/admin_media/css/" => var.basedir + "django/admin_css/",
"/admin_media/" => var.basedir + "django/sdk/django/contrib<wbr></wbr>/admin/media/",
"/file/" => var.basedir + "django/website/file/",
)
url.rewrite-once = (
"^(/.*)$" => "/django.fcgi$1",
)
$HTTP["url"] =~ "^/bbs/" {
accesslog.filename = "|/usr/sbin/cronolog " + var.logdir +
"/bbs/access_log.%Y%m%d"
}
$HTTP["url"] !~ "^/bbs/" {
accesslog.filename = "|/usr/sbin/cronolog " + var.logdir +
"/other/access_log.%Y%m%d"
}
dir-listing.activate = "disable"
但是用manage自带的runserver就可以访问.
配置文件和网上的几乎一样,django是svn最新版.
研究了一个下午+一个晚上还是没有解决方案
django.fcgi
______________________________<wbr></wbr>_______________
#!/usr/bin/python
import sys, os
PROJECT_PATH='/home/www/django<wbr></wbr>/website'
#sys.path.insert(0, PROJECT_PATH)
os.chdir(PROJECT_PATH)
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(
method="prefork",
daemonize='false',
socket="/var/run/lighttpd<wbr></wbr>/lighttpd-django.sock",
#host=" 127.0.0.1",
#port=9001,
)
______________________________<wbr></wbr>__________________
/etc/lighttpd/lighttpd.conf
______________________________<wbr></wbr>_________________
var.basedir = "/home/www/"
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
server.modules = (
"mod_rewrite",
"mod_alias",
"mod_access",
"mod_fastcgi",
"mod_accesslog"
)
include "mime-types.conf"
fastcgi.server = (
".php" =>
((
"socket"=>"/var/run/lighttpd<wbr></wbr>/lighttpd-fastcgi-php-" + PID +
".socket",
"bin-path" => "/usr/bin/php-cgi",
<script type="text/javascript"></script> "min-procs" => 8,
"max-procs" => 20,
"idle-timeout" => 20
)),
"/django.fcgi" =>
("main" =>(
#"host" => " 127.0.0.1",
#"port" => 9001,
"check-local" => "disable",
"socket" =>
"/var/run/lighttpd/lighttpd-django.sock",
"bin-path" => var.basedir + "django.fcgi",
))
)
server.username = "stuhome"
server.groupname = "lighttpd"
server.document-root = var.basedir
server.pid-file = "/var/run/lighttpd.pid"
server.errorlog = var.logdir + "/error.log"
server.follow-symlink = "enable"
server.event-handler = "linux-sysepoll"
server.port = 80
static-file.exclude-extensions = (".php", ".pl", ".py", ".cgi", ".fcgi")
alias.url = (
<script type="text/javascript"></script> "/admin_media/css/" => var.basedir + "django/admin_css/",
"/admin_media/" => var.basedir + "django/sdk/django/contrib<wbr></wbr>/admin/media/",
"/file/" => var.basedir + "django/website/file/",
)
url.rewrite-once = (
"^(/.*)$" => "/django.fcgi$1",
)
$HTTP["url"] =~ "^/bbs/" {
accesslog.filename = "|/usr/sbin/cronolog " + var.logdir +
"/bbs/access_log.%Y%m%d"
}
$HTTP["url"] !~ "^/bbs/" {
accesslog.filename = "|/usr/sbin/cronolog " + var.logdir +
"/other/access_log.%Y%m%d"
}
dir-listing.activate = "disable"