Configure Nginx-based django site under Ubuntu9.10

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.