• CentOS6.x 优化脚本


    这个是CentOS安装常用软件及优化脚本:

    #! /bin/sh

    # update yum
    yum -y update
    yum upgrade -y

    # 1、安装yum优先级插件
    yum install yum-priorities

    # 2、epel
    rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

    # 3、修改/etc/yum.repos.d/epel.repo文件
    sed -i '$a priority=11' /etc/yum.repos.d/epel.repo

    # 4、重建缓存
    yum makecache

    # 5、安装Yum加速组件
    yum -y install yum-fastestmirror
    yum repolist
    yum clean all
    yum makecache

    # 6、安装常用工具
    yum -y install vim-enhanced wget lrzsz
    yum -y install gcc gcc-c++ kernel-devel ntp vim-enhanced flex bison autoconf make automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel libxml2-devel curl-devel libicu libicu-devel libmcrypt libmcrypt-devel libmhash libmhash-devel pcre-devel libtool-libs gd file patch mlocate diffutils readline-devel glibc-devel glib2-devel libcap-devel

    # 7、安装编译软件等所需开发工具包组
    yum -y groupinstall "Desktop Platform Development" "Development tools" "Server Platform Development"

    # 8、selinux
    setenforce 0
    sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config

    # 9、时间同步
    cronfileroot="/var/spool/cron/root"
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    if [ ! -f $cronfileroot ]; then
    touch ${cronfileroot}
    chmod 600 ${cronfileroot}
    fi
    sed -i '$a */30 * * * * /usr/sbin/ntpdate us.pool.ntp.org >> /var/log/crontab.log 2>&1' ${cronfileroot}
    service crond restart

    # 10、ulimit
    sed -i '$a * - nproc 102400' /etc/security/limits.conf
    sed -i '$a * - nofile 102400' /etc/security/limits.conf

    # 11、nload
    yum install -y nload

    # 12、iftop
    yum install -y iftop

  • 相关阅读:
    大型网站架构系列:20本技术书籍推荐
    程序员进阶顺序
    乐观锁与悲观锁——解决并发问题
    Redis的事务功能详解
    驱动开发(8)处理设备I/O控制函数DeviceIoControl
    钱币兑换问题(杭电1284)(母函数)
    jqm文件上传,上传图片,jqm的表单操作,jqm的ajax的使用,jqm文件操作大全,文件操作demo
    问:简述一下内部类的实质是什么?
    Android 删除新版安卓fragment_main.xml
    保温饭盒毕业设计程序
  • 原文地址:https://www.cnblogs.com/bury12/p/5631695.html
Copyright © 2020-2023  润新知