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