How to install Django (python) on Nginx

apt-get update
apt-get upgrade
apt-get install build-essential psmisc python-dev libxml2 libxml2-dev python-setuptools MYSQL-python
apt-get install python-pip
apt-get install virtualenv supervisor

Download and compile uWSGI:

cd /opt/
tar -zxvf uwsgi-latest.tar.gz
mv uwsgi-1.2.3/ uwsgi/
cd uwsgi/
python install
Read the rest

Redirect Sub-Directory to Sub-Domain while retaining the links

Options -Indexes +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]
RedirectMatch 301 ^/linux/(.*)$$1

In this example I’m redirecting my visitors and spiders from subdirectory called “linux” to a sub-domain. The redirect is permanent (301), … Read the rest