Strange Django Utils Problem. But Lighttpd is in the spotlight

0 views
Skip to first unread message

madhav

unread,
Dec 8, 2008, 9:37:28 AM12/8/08
to lighttpd
I have a very strange problem. This may sound more of a django problem
but not a lighttpd issue. But its actuall the other way round. My
project directory has got a directory named "utils" and all the
modules related to the utils folder alone are not getting imported.
All the rest are getting imported. That too this problem is only when
I run the fcgi daemon(app server). When I try to import the same module
(which is in utils folder) from DJANGO SHELL, its gettings imported
properly. I dont know why? And that too this problem only resulted
AFTER I restarted my production server(which means I have restarted my
app and web servers). I am of the opinion like this is a pythonpath
issue and not a thing related to the codebase(which remains
untouched). Any project path related issues with lighttpd is the key
here? Please help me out. What is with this utils thing anyway?
This is how I run the app server: PYTHONPATH=/repo/django_src /usr/bin/
python2.4 manage.py --
settings=PRODUCTION_settings runfcgi method=prefork host=127.0.0.1
port=8080
This is what the lighttpd.conf has:
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_alias",
"mod_access",
"mod_auth",
"mod_status",
"mod_fastcgi",
"mod_compress",
"mod_ssi",
"mod_expire",
"mod_accesslog" )

server.document-root = "/work/myproj/site_media/"

index-file.names = ( "myproj.fcgi","index.html",
"index.htm", "default.htm" )

mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jar" => "application/x-java-archive",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar",
# default mime type
"" => "application/octet-stream",
)

deflate.mimetypes = ( "text/html" )

$HTTP["useragent"] =~ "Firefox" {
deflate.mimetypes += ( "text/javascript", "text/css" )
}

url.access-deny = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

server.port =80

server.pid-file = "/var/run/lighttpd.pid"

server.errorfile-prefix = "/work/lighttpd/status-"

compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/plain", "text/html", "application/
x-javascript", "text/css","text/javascript")

$HTTP["url"] =~ "^/site_media/" {
expire.url = ( "" => "access 168 hours" )
}
$HTTP["url"] =~ "\.(jpg|gif|png|css|js)$" {
expire.url = ( "" => "access 168 hours" )
}

$HTTP["host"] =~ "mydomain\.com" {
server.document-root = "/work/myproj/site_media/"
accesslog.filename = "/work/lighttpd/logs/www/access.log"
server.errorlog = "/work/lighttpd/logs/www/error.log"
server.error-handler-404 = "/myproj.fcgi"
fastcgi.server = (
"/myproj.fcgi" => (
"main" => ( "host" => "127.0.0.1", "port" => 8080, "check-
local" => "disable","idle-timeout" => 20)
)
)
alias.url = (
"/media/" => "/repo/django_src/django/contrib/admin/media/",
)
url.rewrite-once = (
"^(/media.*)$" => "$1",
"^/site_media(.*)$" => "$1",
"^/favicon\.ico$" => "/site_media/image/favicon.ico",
"^/robots\.txt$" => "/robots.txt",
"^(/.*)$" => "/myproj.fcgi$1",
)
}
Reply all
Reply to author
Forward
0 new messages