zoukankan      html  css  js  c++  java
  • 系统优化小脚本

    #!/bin/bash
    # Check if user is root

    cur_dir=$(pwd)

    host=$(hostname)

    if [ $(id -u) != "0" ]; then

    echo "Error: You must be root to run this script, please use root to install lnmp"

    exit 1
    fi

    yum -y install redhat-lsb-core

    if lsb_release -r -s | grep 7; then

    chmod 777 /etc/rc.d/rc.local


    systemctl enable rc-local.service

    systemctl --system daemon-reload

    systemctl start rc-local.service

    systemctl status rc-local.service

    systemctl stop firewalld.service

    systemctl disable firewalld.service

    echo -e "========================================================================= "

    else

    service iptables stop

    chkconfig --level 2345 iptables off

    echo -e "========================================================================= "

    fi

    echo -e "#SELINUX=enforcing #SELINUXTYPE=targeted SELINUX=disabled SETLOCALDEFS=0" > /etc/selinux/config


    sleep 1

    echo -e "========================================================================= "

    rm -rf /etc/my.cnf
    rm -rf /etc/init.d/mysql*
    rm -rf /etc/init.d/php*
    rm -rf /etc/init.d/http*
    rm -rf /etc/php.ini

    sleep 1

    yum -y remove httpd
    yum -y remove http
    yum -y remove php
    yum -y remove mysql
    yum -y remove mysqld
    yum -y remove mariadb

    echo -e "========================================================================= "
    sleep 1

    echo "========================================================================="
    echo " "
    echo " Yum Installation "
    echo " "
    echo -e "========================================================================= "
    sleep 1

    echo -e "========================================================================= "

    if lsb_release -r -s | grep 7; then

    yum -y install readline* net-tools icu perl-DBI perl-Net-Daemon perl-PlRPC libcap-devel lynx perl-DBD-MySQL readline-devel net-tools* dos2unix gcc* xmlto yum* screen vim* psmisc wget lrzsz pcre-devel iptraf sysstat libevent libevent-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker tar rrdtool ntp* dos2unix setup* net-snmp-utils net-snmp-devel ruby ruby-devel php-snmp cmake net-snmp-perl net-snmp net-snmp-libs wget elinks make autoconf213 m4 gcc gcc-c++ automake autoconf fontconfig fontconfig-devel libjpeg libjpeg* libjpeg-devel libpng libpng-devel freetype freetype* freetype-devel libxml2 libxml2-devel libdhash libdhash-devel libxslt* zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2* libicu libicu-devel ncurses ncurses-devel xmlrpc-c xmlrpc-c-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel openldap-clients openldap-servers gd gd-devel pam* gettext gettext-devel keyutils compat* mpfr cpp libgomp libstdc++-devel keyutils-libs-devel libcom_err-devel libsepol-devel libXpm* php-gd ncurses* libtool* patch unzip bison-devel bison libcom_err-devel libsepol-devel gtk* libselinux-devel libtiff* php-common policycoreutils telnet t1lib t1lib* nasm nasm*

    echo "=================================yum 7 end ========================================"

    sleep 1

    else

    yum -y install readline* gcc* xmlto kernel-devel yum* screen vim* psmisc wget lrzsz pcre-devel libtidy libtidy-devel iptraf sysstat libevent libevent-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker tar rrdtool ntp* dos2unix setup* net-snmp-utils net-snmp-devel ruby ruby-devel php-snmp cmake net-snmp-perl net-snmp net-snmp-libs wget elinks make autoconf213 m4 gcc gcc-c++ automake autoconf fontconfig fontconfig-devel libjpeg libjpeg* libjpeg-devel libpng libpng-devel freetype freetype* freetype-devel libxml2 libxml2-devel libdhash libdhash-devel libxslt* zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2* libc-client libc-client-devel libicu-devel ncurses ncurses-devel xmlrpc-c xmlrpc-c-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel openldap-clients openldap-servers gd gd-devel pam* gettext gettext-devel keyutils compat* mpfr cpp libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libXpm* php-gd ncurses* libtool* patch unzip bison-devel bison libcom_err-devel libsepol-devel gtk* libselinux-devel libtiff libtiff* php-common policycoreutils telnet t1lib t1lib* nasm nasm*

    echo "=================================yum 6 end ========================================"

    fi

    sleep 1

    cd $cur_dir/nginx

    yum -y install libtidy*.rpm


    sleep 1

    echo -e "========================================================================= "

  • 相关阅读:
    关于本博客
    洛谷P3387 【模板】缩点 题解
    spfa学习笔记
    Google Chrome Download
    Kosaraju算法学习
    fhq treap 学习笔记
    OIerChat
    python request.get(h.html),用xpath获取数据为空
    k8s 用ingress暴露集群环境中的服务。
    harbor push 报received unexpected HTTP status: 500 Internal Server Error
  • 原文地址:https://www.cnblogs.com/donghui521/p/9717079.html
Copyright © 2011-2022 走看看