CodeKitz
Log in
Install Django Python (CentOS6)
Python
Django
CentOS 6
Edit
Dependency
Setup Timezone
Initialized CentOS Server
Install Python 2.7 (CentOS6)
Install MySQL
Option
Install Python 2.7 (CentOS6)
Script
Copy
# Setup Timezone function isinstalled { if yum list installed | grep "$@"; then true else false fi } RED=`tput setaf 1` GREEN=`tput setaf 2` RESET=`tput sgr0` if isinstalled "ntp"; then echo "Install ntp .......... [${GREEN}OK${RESET}]"; else yum install ntp -y; mv /etc/localtime /etc/localtime.bak ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime ntpd chkconfig ntpd on echo "Install ntp .......... [${GREEN}Installed${RESET}]"; fi # Initialized CentOS Server yum groupinstall "Development tools" -y yum install nano wget -y yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel -y yum install libjpeg-devel freetype-devel libpng-devel -y yum install libxml2-devel libxslt-devel -y yum install epel-release -y setenforce 0 # TODO: disable # nano /etc/selinux/config # SELINUX=disabled # Install Python 2.7 (CentOS6) cd /opt wget http://www.python.org/ftp/python/{{ PYTHON_VERSION }}/Python-{{ PYTHON_VERSION }}.tgz tar zxvf Python-{{ PYTHON_VERSION }}.tgz cd Python-{{ PYTHON_VERSION }} ./configure --prefix=/usr/local --with-threads --enable-shared make && make altinstall cd /usr/local/bin ls -ltr python* ln -s /usr/local/bin/python2.7 /usr/local/bin/python echo /usr/local/lib >> /etc/ld.so.conf /sbin/ldconfig wget https://bootstrap.pypa.io/get-pip.py python get-pip.py pip install gnureadline # Install MySQL yum install mysql-devel mysql-server mysql -y chkconfig mysqld on service mysqld start mysql_secure_installation # Install Django Python (CentOS6) pip install django pip install mysqlclient