Build a high-performance LAMP Platform Based on CentOS

Source: Internet
Author: User
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)

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.