CentOS6一键升级Python2.7及安装常用工具脚本

  • A+
所属分类:其他杂项
本文信息本文由方法SEO顾问发表于2017-02-2219:22:39,共 2144 字,转载请注明:CentOS6一键升级Python2.7及安装常用工具脚本_【方法SEO顾问】

CentOS6一键升级Python2.7及安装常用工具脚本

#!/bin/bash
#
# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: You must be ROOT to run this script"
    exit 1
fi
###升级yum
#yum upgrade -y
#yum clean all

###安装常用工具
yum -y install vixie-cron crontabs vim screen wget

###安装依赖库
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers sqlite-devel libaio libaio-devel 

###删除yum的历史记录
rm -rf /var/lib/yum/history/*.sqlite

###下载Python-2.7.10
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar -xvf Python-2.7.10.tgz
cd Python-2.7.10

###编译
./configure --prefix=/usr/local
make && make altinstall
ln -fs /usr/local/bin/python2.7 /usr/local/bin/python
python -V
sleep 5

###安装setuptools
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-18.2.tar.gz
tar xzvf setuptools-18.2.tar.gz
cd setuptools-18.2
python setup.py install
easy_install pip

###安装pip
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz
tar xzvf pip-7.1.2.tar.gz
cd pip-7.1.2
python setup.py install

###升级pip
pip install --upgrade pip
sleep 5

###安装Python常用模块
pip install requests
pip install cymysql

###清空防火墙规则
iptables -F
iptables -Z
iptables -X
service iptables save
service iptables restart

###修改系统时间
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

###安装fail2ban
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install fail2ban

###安装一键防CC脚本
wget -O install.sh --no-check-certificate https://zhangge.net/wp-content/uploads/files/cckiller/install.sh?ver=1.0.5 && chmod +x install.sh && bash install.sh -i

###安装lnmp1.4
#screen -S lnmp 
#wget -c http://soft.vpser.net/lnmp/lnmp1.4beta.tar.gz && tar zxf lnmp1.4beta.tar.gz && cd lnmp1.4 && ./install.sh lnmp

###安装91yun锐速破解版
###参考文章:https://www.91yun.org/archives/683
###卸载方法:chattr -i /serverspeeder/etc/apx* && /serverspeeder/bin/serverSpeeder.sh uninstall -f
#wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/serverspeeder/master/serverspeeder-all.sh && bash serverspeeder-all.sh

  • 版权声明:除非注明,本博客均为北京SEO方法的原创文章,转载或引用请以超链接形式标明本文地址,否则会在SEO圈内公开此种不尊重版权的行为,谢谢合作!本文地址:https://seofangfa.com/other-note/centos6-bash.html
  • 转载请注明:CentOS6一键升级Python2.7及安装常用工具脚本_ 【方法SEO顾问】

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: