On Apr 9, 10:51 am, Daniel Roseman <
roseman.dan...@googlemail.com>
wrote:
> On Apr 9, 3:35 pm, Karim Hamdan <
karimham...@gmail.com> wrote:
>
> > Let me rephrase my question. I followed
> > this<
http://groups.google.com/group/django-users/browse_thread/thread/8cd8...>HowTo
> > on this group that describes how to run Django using lighty with fcgi,
> > I can access my project website successfully but I fail to access Django's
> > admin site and get a 404 Not Found error instead. I am running
> > lighttpd-1.4.19 and python-django 1.0-1ubuntu1 on my Ubuntu Intrepid
> > machine.
>
You can also try nginx. The path for nginx seems to be more well trod
by the Django community. Here is my nginx.conf. With that nginx,
Django needs to run under fastcgi:
./manage.py runfcgi host=127.0.0.1 port=8080
-Adam
#######################################################################
#
# This is the main Nginx configuration file.
#
# More information about the configuration options is available on
# * the English wiki -
http://wiki.codemongers.com/Main
# * the Russian documentation -
http://sysoev.ru/nginx/
#
#######################################################################
#----------------------------------------------------------------------
# Main Module - directives that cover basic functionality
#
#
http://wiki.codemongers.com/NginxMainModule
#
#----------------------------------------------------------------------
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
#----------------------------------------------------------------------
# Events Module
#
#
http://wiki.codemongers.com/NginxEventsModule
#
#----------------------------------------------------------------------
events {
worker_connections 1024;
}
#----------------------------------------------------------------------
# HTTP Core Module
#
#
http://wiki.codemongers.com/NginxHttpCoreModule
#
#----------------------------------------------------------------------
http {
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/.htpasswd;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local]
$request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
if ($host = '
www.example.com' ) {
rewrite ^/(.*)$
http://example.com/$1 permanent;
}
location ^~ /static/ {
root /var/www/example;
}
location ^~ /media/ {
root /usr/lib/python2.5/site-packages/django/contrib/
admin;
}
location / {
# host and port to fastcgi server
fastcgi_pass
127.0.0.1:8080;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}