1. Install the sudoapt-getinstallpython-djangopython-flupnginx2. Modify the nginx configuration file sudovim/etc/nginx. conf For details, see here: http://articles.slicehost.com/2008/5/15/ubuntu-hardy-nginx-configuration3.create a virtual host (fo
1. Install
Sudo apt-get install python-django python-flup nginx
2. Modify the nginx configuration file
Sudo vim/etc/nginx. conf
See here for details: http://articles.slicehost.com/2008/5/15/Ubuntu-hardy-nginx-configuration
3. Create a VM (for django)
Sudo vim/etc/nginx/sites-available/foo.com
Enter the following text:
Server {
Listen 80;
Server_name foo.com;
Access_log/home/foo/public_html/foo/log/access. log;
Error_log/home/foo/public_html/foo/log/error. log;
Location /{
# Host and port to fastcgi server
Fastcgi_pass 127.0.0.1: 7718;
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;
}
}
Then create a link:
Sudo ln-s/usr/local/nginx/sites-available/foo.com/usr/local/nginx/sites-enabled/foo.com
4. Start djangosite and nginx
Python/home/mitnk/public_html/foo/manage. py runfcgi host = 127.0.0.1 port = 7718
Sudo/etc/init. d/nginx start