Basic Linux optimization and Linux Optimization
Summary:
Yiqing, Yijing, yizeng,Dual optimization, four settings, and seven others
Yiqing:Regularly clear logs/var/spool/clientsqueue
Yijing:Streamline startup services
Increment:Increase file descriptor
Two advantages:Linux Kernel Parameter Optimization and yum source optimization
Four settings:Set the character set of the system, set ssh logon restrictions, set the boot prompt and kernel information, and set the block size.
Seven others:File System Optimization, sync data synchronization to disk, no update timestamp, lock system key files, time synchronization, sudo centralized management, firewall shutdown and selinux
1. sync data synchronized to disk
Async sync
2. Do not update the timestamp
Noatime
3. File System Optimization: Disable the ext3 and ext4 log Functions
Disable services that are less important to data
4. Set the block size, generally 4 K
Mkfs-t ext3-B 4096/dev/sda1
5. Lock key files of the system
Chattr +/-I/etc/passwd
6. linux kernel optimization (Parameter Optimization)
............
7. Set the boot prompt and system information
/Etc/motd/etc/issue
8. Set up the yum source of the system and optimize the system (upgrade)
/Etc/yum. repos. d/
9. Time Synchronization. A time synchronization server ntpserver can be set up between 50-servers.
/Usr/sbin/ntpdate time.windows.com
10. Set the character set of the system
/Etc/sysconfig/i18n
11. Use sudo tools to centralize user management
Mongodo
12. Restrict ssh Logon Settings, such as changing the port, disabling root logon, and disabling password-free logon.
/Etc/ssh/sshd. conf
13. Increase the file descriptor
Echo '*-nofile 65535'>/etc/security/limits. conf
14. timed cleanup/var/spool/clientsqueue/
Write the script and place it in the scheduled task for regular cleanup.
15. Streamline startup services
A) setup, check the startup Service
B) Input ntsysv on the terminal
C) script writing
Cat/server/scripts/chkinfo. sh
# Setup sys start server or process
For I in 'chkconfig -- list | grep 3: on | awk' {print $1} ''; do chkconfig -- level 3 $ I off; done
/Bin/sh/server/scripts/chkinfo. sh
For details about the above optimization, refer to Centos production server environment to minimize the security after installation and optimize the configuration.