There are few articles on the Ubuntu environment, and searching for some problems is more troublesome, and it will be a combination of others ' practices and their own. This article mainly explains the basic installation, as to how Django1.9 deployed to Apache2.4 to go to another blog post. My final system environment is: UBUNTU1404+PYTHON2.7+DJANGO1.9+APACHE2.4+MYSQL5.5+MOD_WSGI.
1. Installing Django1.9
Direct Terminal input pip install Django, normal installation can be (no pip first to install PIP).
2. Installing Apache2.4
Enter the sudo apt-get install apache2 directly in the terminal interface, and the installation process is normal.
3. Installing Mysql5.5
Enter the sudo apt-get install mysql-server mysql-client installation directly in the terminal interface.
A. mysql support python
Terminal input pip install Mysql-python installation.
B. mysql support Apache (choose install)
Terminal input sudo apt-get install libapache2-mod-auth-mysql installation.
4. Prepare to install Mod_wsgi
Here direct PIP installation words may have problems, the following is a description of the two I encountered error.
A. ' Missing Apache httpd server packages. '% APXS
Only the last error message is intercepted, the keyword is apxs, the normal installation of Apache is not installed APXS, so we need to install the Apache APXS extension, the terminal input command sudo apt-get install Apache2-dev. After the installation is complete, you can find apxs2 under path/usr/bin, and there is a apxs.
B. Unicodedecodeerror
This error may occur after the above error has been resolved, which is also encountered when writing the program, the problem of character encoding. Go to Path/usr/lib/python2.7/, modify the next sitecustomize.py file. Add the following two lines of code.
Import syssys.setdefaultencoding ('utf-8')
5. Installing Mod_wsgi
Terminal input sudo pip install Mod_wsgi can perform the installation, the reason for the need to add sudo, it is possible to encounter a hint that read and write a file permissions are not enough, so simply install as root.
ubuntu1404+django1.9+apache2.4 Deployment Configuration