ubuntu1404+django1.9+apache2.4 Deployment Configuration

Source: Internet
Author: User
Tags install django pip install django

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

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.