CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django

Python installation Altinstall because it does not affect Yum

% yum -y groupinstall "Development Tools"
% yum -y install expat-devel db4-devel gdbm-devel sqlite-devel readline-devel 
zlib zlib-devel bzip2-devel openssl-devel ncurses-devel
% cd /usr/local/src
% wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
% tar xjf Python-2.7.3.tar.bz2
% cd Python-2.7.3
% ./configure --with-threads --enable-shared
% make
% make altinstall
% echo '/usr/local/lib' > /etc/ld.so.conf.d/python2.7.conf
% ldconfig

Installation of setuptools

% curl http://peak.telecommunity.com/dist/ez_setup.py | python2.7

pip installation

% curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python2.7

Apache installation

% yum -y install httpd httpd-devel
% mkdir -p /var/log/httpd/www.example.com
% vi /etc/httpd/conf.d/www.example.com.conf
<VirtualHost *:80>
    ServerName www.example.com:80
    DocumentRoot /home/www/www.example.com/example
    CustomLog "/var/log/httpd/www.example.com/access_log" common
    ErrorLog  "/var/log/httpd/www.example.com/error_log"
    WSGIDaemonProcess example python-path=/home/www/www.example.com:/usr/local/lib/python2.7/site-packages
    WSGIProcessGroup example
    WSGIScriptAlias / /home/www/www.example.com/example/wsgi.py
    WSGIScriptReloading On
    <Directory /home/www/www.example.com/example>
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Install mod_wsgi

% cd /usr/local/src
% wget http://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz
% tar vzxf mod_wsgi-3.4.tar.gz
% cd mod_wsgi-3.4
% ./configure --with-python=/usr/local/bin/python2.7
% make
% make install
% vi /etc/httpd/conf.d/wsgi.conf
LoadModule wsgi_module modules/mod_wsgi.so

Django installation

% pip-2.7 install django

Django project creation

% useradd www
% su - www
% django-admin.py startproject example
% mv example www.example.com

It moved for the time being

Recommended Posts

CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
Python3 + Django ~ Mac ~ with Apache
Install Python 3.7 and Django 3.0 (CentOS)
Run python3 Django1.9 with mod_wsgi (deploy)
Django + Apache with mod_wsgi on Windows Server 2016
A memo with Python2.7 and Python3 on CentOS
CentOS8 + Apache2.4 + pyenv + mod_wsgi + Django project deployment
Django 1.11 started with Python3.6
Programming with Python and Tkinter
Encryption and decryption with Python
Do Django with CodeStar (Python3.6.8, Django2.2.9)
Python and hardware-Using RS232C with Python-
Run with CentOS7 + Apache2.4 + Python3.6 for the time being
Apache mod_auth_tkt and Python AuthTkt
Do Django with CodeStar (Python3.8, Django2.1.15)
Getting Started with Python Django (1)
Getting Started with Python Django (4)
Getting Started with Python Django (3)
macports Apache, Python 3.3 + non-macports mod_wsgi3.4
Django --Apache mod_wsgi virtualhost deployment
Getting Started with Python Django (6)
Investigate Java and python data exchange with Apache Arrow
python with pyenv and venv
Getting Started with Python Django (5)
Works with Python and R
Word Count with Apache Spark and python (Mac OS X)
Set up a web server with CentOS7 + Anaconda + Django + Apache
Communicate with FX-5204PS with Python and PyUSB
Shining life with Python and OpenCV
Robot running with Arduino and python
Install Python 2.7.9 and Python 3.4.x with pip.
Neural network with OpenCV 3 and Python 3
AM modulation and demodulation with python
Make apache log csv with python
[Python] font family and font with matplotlib
Scraping with Node, Ruby and Python
Scraping with Python, Selenium and Chromedriver
HTTPS with Django and Let's Encrypt
Scraping with Python and Beautiful Soup
Set multiple WSGIPythonPath with Apache + mod_wsgi
JSON encoding and decoding with python
Hadoop introduction and MapReduce with Python
Reading and writing NetCDF with Python
I played with PyQt5 and Python3
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Reading and writing CSV with Python
Multiple integrals with Python and Sympy
Until you run python with apache
Coexistence of Python2 and 3 with CircleCI (1.0)
Easy modeling with Blender and Python
Sugoroku game and addition game with python
FM modulation and demodulation with Python
Create an environment for Django x Apache x mod_wsgi with Vagrant (Ubuntu 16.04)
Make a scraping app with Python + Django + AWS and change jobs
Communicate between Elixir and Python with gRPC
Calculate and display standard weight with python
Monitor Mojo outages with Python and Skype
FM modulation and demodulation with Python Part 3
[Automation] Manipulate mouse and keyboard with Python
Handle multiple Django projects with Apache (WSGIDaemonProcess)
Passwordless authentication with RDS and IAM (Python)