虚拟机Linux模板机配置

一、Minalmysql

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

软件包:tree nmap syssate lrzsz doc2unix telnetsql


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


timedatectl set-timezone Asia/Shanghaicentos

timedatectl  statusssh

阿里公共DNS:223.5.5.5 223.6.6.6ide


三、yum源,epel源优化

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



http://mirrors.aliyun.comunix


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



四、关闭selinux和iptables

systemctl stop firewalld

systemctl disable firewalld



五、ssh优化

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

    PermitEmptyPasswords no

    UseDNS no

    GSSAPIAuthentication no


#/etc/init.d/ssh relaod


六、精简开机系统启动

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

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



七、时间同步

/usr/sbin/ntpdate time1.aliyun.com


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


(time1-time7可用)

八、字符集

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

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


. /etc/sysconfig/i18n


九、文件描述符

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

 

十、mysql字符集 

character-set-server=utf8

init-connect='set names utf8'

collation-server=utf-8_general_ci

相关文章
相关标签/搜索