Centos6.5 install Python2.7 & django & mysql & apache
#! /bin/bash
#su root
#get python2.7
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
#install python
tar zxvf Python-2.7.9.tgz
cd Python-2.7.9
./configure --enable-shared
make
make install
cd ..
rm -rf Python*
mv /usr/bin/python /usr/bin/python.old.2.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
echo /usr/local/lib> /etc/ld.so.conf.d/python2.7.conf
ldconfig
#install pip
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
rm -rf setuptools*
wget https://pypi.python.org/packages/source/p/pip/pip-6.0.8.tar.gz#md5=2332e6f97e75ded3bddde0ced01dbda3
tar zxvf pip-6.0.8.tar.gz
cd pip-6.0.8
python setup.py install
cd ..
rm -rf pip*
#install django
pip install django
#yum install sqlite-devel
#pip install pysqlite
pip install MySQL-python
#install apache
yum install httpd
yum install httpd-devel
#install mod_wsgi
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.4.10.tar.gz
tar zxvf 4.4.10.tar.gz
cd mod_wsgi-4.4.10/
./configure -with-python=/usr/local/bin/python #--with-apxs=/usr/sbin/apxs
make && make install
cd ..
rm -rf mod_wsgi-4.4.10
rm -rf 4.4.10.tar.gz
#install mysql
yum install mysql
sduo yum install mysql-server
chkconfig -add mysqld
chkconfig --level 35 mysqld on
service mysqld start
#mysqladmin -u root password jmbkeyes #set password
#vi /usr/bin/yum
#将文件头部的#!/usr/bin/python修改为:
#!/usr/bin/python2.6