Build a high-performance LAMP Platform Based on CentOS-Linux Enterprise Application-Linux server application information. The following is a detailed description. Author: NetSeek http://www.linuxtone.org (it o & M | cluster architecture | Performance Tuning)
You are welcome to reprint the document. During reprinting, please be sure to mark the original source and author information of the article as hyperlinks and this statement.
Outline:
I. System Installation
Ii. Compile and install the Basic Environment
3. Configure virtual hosts and optimize Basic Performance
Iv. Basic Security Settings
V. Appendix and related introductions
I. System Installation
1. Partition
/Boot around M
2 times the physical memory of SWAP (If your physical memory is larger than 4 GB, allocate 4 GB)
/Usr/local 15G (for software installation)
/All data space remaining
2. system initialization script (disable unnecessary services as needed)
CODE: # vi init. sh
------------------- Cut begin -------------------------------------------
# Welcome
Cat <EOF
+ -------------------------------------------------------------- +
| === Welcome to Centos System init ==|
+ -------------- Http://www.linuxtone.org ------------------------ +
+ ---------------------- Author: NetSeek -------------------------- +
EOF
# Disable ipv6
Cat <EOF
+ -------------------------------------------------------------- +
| === Welcome to Disable IPV6 ==|
+ -------------------------------------------------------------- +
EOF
Echo "alias net-pf-10 off">/etc/modprobe. conf
Echo "alias ipv6 off">/etc/modprobe. conf
/Sbin/chkconfig -- level 35 ip6tables off
Echo "ipv6 is disabled! "
# Disable selinux
Sed-I '/SELINUX/s/enforcing/disabled/'/etc/selinux/config
Echo "selinux is disabled, you must reboot! "
# Vim
Sed-I "8 s/^/alias vi = 'vim '/"/root/. bashrc
Echo 'syntax on'>/root/. vimrc
# Zh_cn
Sed-I-e's/^ LANG =. */LANG = "zh_CN.GB18030"/'/etc/sysconfig/i18n
# Tunoff services
#--------------------------------------------------------------------------------
Cat <EOF
+ -------------------------------------------------------------- +
| === Welcome to Tunoff services ===|
+ -------------------------------------------------------------- +
EOF
#---------------------------------------------------------------------------------
For I in 'ls/etc/rc3.d/S *'
Do
CURSRV = 'echo $ I | cut-c 15 -'
Echo $ CURSRV
Case $ CURSRV in
Crond | irqbalance | microcode_ctl | network | random | sendmail | sshd | syslog | local | mysqld)
Echo "Base services, Skip! "
;;
*)
Echo "change $ CURSRV to off"
Chkconfig -- level 235 $ CURSRV off
Service $ CURSRV stop
;;
Esac
Done
------------------- Cut end -------------------------------------------
# Sh init. sh (execute the script saved above and restart it later) |