Linux system Environment Automation configuration ~init.sh Sharing

Source: Internet
Author: User
Tags aliyun

#!/bin/bash#---sysinit script by Yxs---#---email: [Email protected]if[["$ (WhoAmI)"!="Root" ]];  Then    Echo "Please run this script as root.">&2Exit1fi#Yumsource Configyum_config () {Yum Install wgetEpel-release-y cd/etc/Yum. repos.d/&&mkdirBak &&MV-F *.repo bak/wget-o/etc/Yum. Repos.d/centos-base.repo http://Mirrors.aliyun.com/repo/centos-7.repo    wget-o/etc/Yum. Repos.d/epel.repo http://Mirrors.aliyun.com/repo/epel-7.repo    YumClean all &&YumMakecacheYum-Y Groupinstall'Development Tools'    Yum-YInstallPython-pipMansLsof iotop iftop net-tools LrzszGCC GCC-c++ MakeCMake libxml2-devel Openssl-devel Curl Curl-develUnzip sudoNTP Libaio-develwgetVim ncurses-devel autoconf automake zlib-devel python-devel bash-completion} #firewalld configiptables_config () {systemctl stop firewalld.service systemctl disable Firewalld.serv Iceifconfig|grep-Q Inet6if[ $? ==0 ]     Then    Echo "Net.ipv6.conf.all.disable_ipv6 = 1">>/etc/sysctl.confEcho "Net.ipv6.conf.default.disable_ipv6 = 1">>/etc/sysctl.confsed-I.'s/::1/#::1/'/etc/hostsfi} #system Configsystem_config () {YumUpdate-y Hostnamectl Set-hostnameYxssed-I."s/selinux=enforcing/selinux=disabled/g"/etc/selinux/Config Timedatectl set-local-rtc1&& Timedatectl Set-timezone asia/ShanghaiYum-YInstallChrony && systemctl start Chronyd.service &&systemctl Enable Chronyd.service} #app_configapp_config () {mkdir-p/usr/download/&& cd/usr/DownloadwgetHttps//www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz    Tar-XVF python-3.6.4. tgz-c/usr/Local CD/usr/local/python-3.6.4    ./configure--prefix=/usr/local/python-3.6.4--enable-shared Make&& Make Install    LN-sv/usr/local/python-3.6.4/bin/python3/usr/bin/Python3LN-sv/usr/local/python-3.6.4/bin/pip3/usr/bin/PIP3 PipInstall--upgrade PipEcho/usr/local/python-3.6.4/lib >>/etc/LD. so.conf/sbin/ldconfig-vmkdir-p/home/Envs virtualenv-p/usr/bin/python3/home/envs/py3envLN-s/home/envs/py3env/bin/activate/root/py3}main () {yum_config iptables_config system_config app_config}mainreboot

Linux system Environment Automation configuration ~init.sh Sharing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.