虛擬機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

相關文章
相關標籤/搜索