Linux operation and Architecture-linux Foundation optimization

Source: Internet
Author: User
Tags i18n

1. View Linux Version

cat/etc/redhat-
6.9 (Final) ———— > view version number uname-m#x86_64 ———— > View System 64-bit /32-bit uname-R #2.6. -696. el6.x86_64 —————— > Kernel version

2. Close SELinux and Iptables

' s#=enforcing#=disabled#g ' /etc/selinux/0 # —————— > Temporary close getenforce/etc/init.d/iptables Stopchkconfig iptables off

3, change the character set, support Chinese, but do not recommend the best use of English character set, prevent garbled problem

Echo $LANGen _us. UTF-8             # —————— > See if the system character set is correct lang=enexport lang=en_us.utf8  # ————— >  "lang=en_us.utf8" >/etc/sysconfig/i18n # —————— >/etc/ sysconfig/i18n                  # —————— > immediately let the configuration file take effect

4. Streamlined boot-up service

Export lang=enchkconfig"crond|sshd|network|rsyslog|sysstat"'{ Print "Chkconfig", $ $, "off"}'|  3: On

5. Time synchronization

' #time Sync by Yanxinjiang at 2017-01-01 ' >>/var/spool/cron/'*/5 * * * */usr/sbin/ntpdate  pool.ntp.org >/dev/null 2>&1' >>/var/spool/cron/-L

6. Change the Yum source

Wget-o/etc/yum.repos.d/centos-base.repo  http://wget-o/etc/yum.repos.d/epel.repo http ://Mirrors.aliyun.com/repo/epel-6.repo

7. enlarge File Descriptor

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

8. Linux kernel optimization

Cat >>/etc/sysctl.conf<<EOFnet.ipv4.tcp_fin_timeout=2Net.ipv4.tcp_tw_reuse=1net.ipv4.tcp_tw_recycle=1net.ipv4.tcp_syncookies=1Net.ipv4.tcp_keepalive_time= -Net.ipv4.ip_local_port_range=4000    65000Net.ipv4.tcp_max_syn_backlog=16384net.ipv4.tcp_max_tw_buckets=36000Net.ipv4.route.gc_timeout= -net.ipv4.tcp_syn_retries=1net.ipv4.tcp_synack_retries=1Net.core.somaxconn=16384Net.core.netdev_max_backlog=16384Net.ipv4.tcp_max_orphans=16384#以下参数是对iptables防火墙的优化, the firewall does not meet the prompts, can be ignored. Net.nf_conntrack_max=25000000Net.netfilter.nf_conntrack_max=25000000net.netfilter.nf_conntrack_tcp_timeout_established= thenet.netfilter.nf_conntrack_tcp_timeout_time_wait= -net.netfilter.nf_conntrack_tcp_timeout_close_wait= -net.netfilter.nf_conntrack_tcp_timeout_fin_wait= -Eofsysctl-P

9. SSH Connection speed optimization

' [email protected] #UseDNS [email protected] [email protected]; [Email protected]^gssapiauthentication [email protected] [email protected]'  /etc/ssh/sshd_ Config/etc/init.d/sshd Reload

10, Common gadget installation

Yum Install Lrzsz nmap Tree Dos2unix NC telnet-y

11, through the use of sudo to control the ordinary user management

123456|passwd--/etc/sudoers/etc/"oldboy  " >>/ etc/-1 /etc/-C

Linux operation and Architecture-linux Foundation optimization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.