Nginx+uwsgi+django

Source: Internet
Author: User
Nginx+uwsgi+django
System environment: Ubuntu 14.04LTS

Nginx

Official website: http://nginx.org/

Installation

1. System Installation

$sudo apt-get install nginx

2. Source code Installation

Download Source package: Recommended Download stable version
Address: http://nginx.org/en/download.html
Installing dependent libraries

Unzip, configure, compile, install

$tar zxvf nginx-1.8.0.tar.gz$cd nginx-1.8.0$.--with-pcre--with-http_ssl_module--with-http_realip_module--with-http_gzip_static_module--with-http_secure_link_module--with-http_stub_status_module--with-debug$make$sudo make install

To view the installation address by command:

whereis nginx

The default installation path is:/usr/local/nginx
At startup Nignx is encountered command unrecognized, found that the Nginx module is not installed full

$sudo apt-get install nginx-core

and start the Nginx.

sudo nginx

Access http://localhost:80 through the browser
Nginx default setting interface means the boot is successful
Welcome to Nginx

3. Nginx Configuration Folder

Conf:/usr/local/nginx/conf

Related commands

Start:

$sudo#$sudo nginx -s start

Shut down:

$sudo-s stop

Restart:

$sudo-s reload

Uwsgi

Installation Tutorial: http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html

1. Installation

$sudo apt-get install uwsgi-plugin-python$sudo apt-get install uwsgi

SOURCE Installation

Download: Http://projects.unbit.it/uwsgi/wiki/WikiStart
Unzip, configure, compile, install

$tar zxvf uwsgi-2.0.6.tar.gz$cd uwsgi-2.0.6$sudopython setup.py install

When the installation is complete, you will be prompted to end of Uwsgi configration

Test Uwsgi

Print version Information

$uwsgi --version

Write a test script, test.py

defapplication(env, start_response):    start_response('200 OK', [('Content-Type','text/html')])    return [b"Hello World"]

Start Uwsgi, use an unoccupied port

$uwsgi--http:9090--wsgi-filetest.py

Enter address in browser access

http://localhost:9090/

Browser output Hello World, indicating successful installation

Related commands

Start:
Execute the appropriate script
Shut down:

$killall-9 uwsgi$killall-s HUP /var$killall-s HUP /usr/local/bin/uwsgi

Django

Installing dependent libraries

$sudo apt-get install python2.7

Installing Django

Download Source: https://www.djangoproject.com/download/
Unzip, configure, compile, install

$tar zxvf Django-1.8.4.tar.gz$cd Django-1.8.4$sudopython setup.py install

Test Django

Print Django Version information

$python>>import django>>django.VERSION(1,8,4'final'0)

When shown above, the Django installation is successful

Reference

Http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html
http://segmentfault.com/q/1010000002523354
http://www.nowamagic.net/academy/detail/1330331
http://www.nowamagic.net/academy/detail/1330334
Http://www.linuxidc.com/Linux/2014-09/106928.htm

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the Nginx+uwsgi+django, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.