1、Minal

软件包组:Base,Compatibility libararies,Debugging tools,Development tools

软件包:tree nmap syssate lrzsz doc2unix telnet


2、ip地址,网关,用户名和密码,主机名,DNS,时区,/etc/hosts


timedatectl set-timezone Asia/Shanghai

timedatectl  status

阿里公共DNS:223.5.5.5 223.6.6.6


3、yum源,epel源

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm



http://mirrors.aliyun.com


mkdir centosyumbackup

mv epel* centosyumbackup/ 

mv CentOS-* centosyumbackup/


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


yum makecache



4、关闭selinux和iptables

systemctl stop firewalld

systemctl disable firewalld



5、ssh优化

vim /etc/ssh/ssh_config  #解决有时候ssh慢的问题

    PermitEmptyPasswords no

    UseDNS no

    GSSAPIAuthentication no


#/etc/init.d/ssh relaod


6、精简开机系统启动

for list in `chkconfig --list`| grep "3:on"|awk '{print $1}'|grep -VE

"crond|network|rsyslog|sshd|sysstate"`;do checkconfig $list off;done



7、时间同步

/usr/sbin/ntpdate time1.aliyun.com


*/5 * * * *   /usr/sbin/ntpdate time1.aliyun.com


(time1-time7可用)

8、字符集

cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori

echo 'LANG="zh_CN.UTF-8"' > echo /etc/sysconfig/i18n


. /etc/sysconfig/i18n


9、文件描述符

 echo  '*  - nofile  65535' >> /etc/security/limits.conf

 

10、mysql字符集 

character-set-server=utf8

init-connect='set names utf8'

collation-server=utf-8_general_ci