首页 > 代码库 > 新系统基础优化--Centos6.6
新系统基础优化--Centos6.6
网络设置: setup设置网络 vi /etc/sysconfig/netwrok-scripts/ifcfg-eth0 删除HWADDR和UUID行 dns:/etc/resolv.conf linux版本,内核查看 cat /etc/redhat-release uname -r uname -m SELINUX [root@lufengcentos ~]# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config [root@lufengcentos ~]# setenforce 0 [root@lufengcentos ~]# getenforce 开机自启动 [root@lufengcentos ~]# for oldboy in `chkconfig --list|grep 3:on|awk ‘{print $1}‘`;do chkconfig --level 3 $oldboy off;done [root@lufengcentos ~]# for oldboy in crond network rsyslog sshd sysstat ;do chkconfig --level 3 $oldboy on;done [root@lufengcentos ~]# chkconfig --list|grep 3:on 防火墙 [root@lufengcentos ~]# /etc/init.d/iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] 中文字符 [root@lufengcentos ~]# cat /etc/sysconfig/i18n LANG="en_US.UTF-8" SYSFONT="latarcyrheb-sun16" [root@lufengcentos ~]# cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori [root@lufengcentos ~]# echo ‘ LANG="zh_CN.UTF-8"‘ >/etc/sysconfig/i18n [root@lufengcentos ~]# source /etc/sysconfig/i18n [root@lufengcentos ~]# echo $LANG 时间同步 [root@lufengcentos ~]# echo ‘#time sync by lufeng @2017-3-14‘ >>/var/spool/cron/root [root@lufengcentos ~]# echo ‘*/5 * * * * /usr/sbin/ntpdate time.nist.gov‘ >/dev/null2>&1 >>/var/spool/cron/root [root@lufengcentos ~]# crontab -l #time sync by lufeng @2017-3-14 */5 * * * * /usr/sbin/ntpdate time.nist.gov 文件描述符设置 [root@lufengcentos ~]# ulimit -n 1024 [root@lufengcentos ~]# vim /etc/security/limits.conf * - nofile 65535 内核优化 [root@lufengcentos ~]# vi /etc/sysctl.conf net.ipv4.tcp_syn_retries = 1 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_keepalive_time = 600 net.ipv4.tcp_keepalive_probes = 3 net.ipv4.tcp_keepalive_intvl =15 net.ipv4.tcp_retries2 = 5 net.ipv4.tcp_fin_timeout = 2 net.ipv4.tcp_max_tw_buckets = 36000 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_max_orphans = 32768 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_wmem = 8192 131072 16777216 net.ipv4.tcp_rmem = 32768 131072 16777216 net.ipv4.tcp_mem = 786432 1048576 1572864 net.ipv4.ip_local_port_range = 1024 65000 net.ipv4.ip_conntrack_max = 65536 net.ipv4.netfilter.ip_conntrack_max=65536 net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=180 net.core.somaxconn = 16384 net.core.netdev_max_backlog = 16384 [root@lufengcentos ~]# sysctl -p
本文出自 “大梦初醒” 博客,请务必保留此出处http://bestlufeng.blog.51cto.com/11790256/1906914
新系统基础优化--Centos6.6
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。