跳到主要内容

CentOS_Minimal 一键优化设置脚本

Public

本一键包用于最小化系统及快速重建系统,特别是免除独服,KVM,VMWare,VirtualBox等平台重装系统的麻烦.

在安装LNMP之前运行下本脚本,减少内存,硬盘,CPU占用...对你有百利而无一害...

-------------------------------------------------------------------------------------------------------------------------------------------------------

  1. cd ~; wget http://fzrxefe.googlecode.com/files/CentOS_Minimal-1.2.tar.gz; tar zxvf CentOS_Minimal-1.2.tar.gz
  2. cd ~/CentOS_Minimal-1.2

复制代码


-------------------------------------------------------------------------------------------------------------------------------------------------------

  1. bash CentOS_Minimal.sh ssh

复制代码


卸载不必要的程序,节约空间;

卸载LNMP(如果安装过的话);

升级系统并清除YUM Package缓存;

预先安装LNMP所需软件包;

更改SSH端口(可选,但强烈建议);

移除不必要的系统启动项

-------------------------------------------------------------------------------------------------------------------------------------------------------

  1. bash CentOS_Minimal.sh configure

复制代码


关闭BASH历史(可选);

初始化syslog(可选);

关闭密码,用密匙登陆(可选,但强烈建议);

设置为中国时区并同步时间(可选);

-------------------------------------------------------------------------------------------------------------------------------------------------------

  1. bash CentOS_Minimal.sh clean

复制代码


清除YUM Package缓存;

-------------------------------------------------------------------------------------------------------------------------------------------------------

  1. bash CentOS_Minimal.sh sshport

复制代码


更改SSH端口;

-------------------------------------------------------------------------------------------------------------------------------------------------------

  1. bash CentOS_Minimal.sh extra

复制代码


安装其他软件包

-------------------------------------------------------------------------------------------------------------------------------------------------------

如果要使用PubKey免密码登陆SSH(推荐):

将下面两行=后改成自己的

  1. PubKeyName=YourPubKeyName
  2. PubKeyLink=http://www.sample.com/

复制代码


直接编辑CentOS_Minimal.sh

  1. vi CentOS_Minimal.sh

复制代码


或者修改后在CentOS_Minimal目录运行以下四行:

  1. PubKeyName=YourPubKeyName
  2. PubKeyLink=http://www.sample.com/
  3. sed -i "s#PubKeyName=.*#PubKeyName=$PubKeyName#g" CentOS_Minimal.sh
  4. 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

最小化系统
0