在安装LNMP之前运行下本脚本,减少内存,硬盘,CPU占用...对你有百利而无一害...
-------------------------------------------------------------------------------------------------------------------------------------------------------
- cd ~; wget http://fzrxefe.googlecode.com/files/CentOS_Minimal-1.2.tar.gz; tar zxvf CentOS_Minimal-1.2.tar.gz
- cd ~/CentOS_Minimal-1.2
- bash CentOS_Minimal.sh ssh
卸载LNMP(如果安装过的话);
升级系统并清除YUM Package缓存;
预先安装LNMP所需软件包;
更改SSH端口(可选,但强烈建议);
移除不必要的系统启动项
-------------------------------------------------------------------------------------------------------------------------------------------------------
- bash CentOS_Minimal.sh configure
初始化syslog(可选);
关闭密码,用密匙登陆(可选,但强烈建议);
设置为中国时区并同步时间(可选);
-------------------------------------------------------------------------------------------------------------------------------------------------------
- bash CentOS_Minimal.sh clean
-------------------------------------------------------------------------------------------------------------------------------------------------------
- bash CentOS_Minimal.sh sshport
-------------------------------------------------------------------------------------------------------------------------------------------------------
- bash CentOS_Minimal.sh extra
-------------------------------------------------------------------------------------------------------------------------------------------------------
如果要使用PubKey免密码登陆SSH(推荐):
将下面两行=后改成自己的
- PubKeyName=YourPubKeyName
- PubKeyLink=http://www.sample.com/
- vi CentOS_Minimal.sh
- PubKeyName=YourPubKeyName
- PubKeyLink=http://www.sample.com/
- sed -i "s#PubKeyName=.*#PubKeyName=$PubKeyName#g" CentOS_Minimal.sh
- sed -i "s#PubKeyLink=.*#PubKeyLink=$PubKeyLink#g" CentOS_Minimal.sh
>> COMPATIBILITY <<
兼容系统:
+ CentOS 5.x x86
+ CentOS 5.x x64
+ CentOS 6.x x86 (not yet)
+ CentOS 6.x x64 (not yet)
兼容平台:
+ Physical Hardware
+ KVM
+ OpenVZ
+ VirtualBox
+ VMWare
+ Xen
---
转载请注明本文标题和链接:《CentOS_Minimal 一键优化设置脚本》
发表评论