先按照正常步骤安装Centos6.5 64位操作系统(网上有很多教程)。
分区过程需要说明一下:
1、选择手动分区
Create Custom Layout
2、选择标准分区
Standard Partition
3、先创建boot分区
Mount Point: /boot
大小分配200M即可
4、创建一个物理卷
LVM Physical Volume
5、将全部空间分配给上面新建的物理卷
Fill to maximum allowable size
6、在上述LVM中创建卷组
LVM Volume Group
7、在LVM卷组中创建swap
File System Type: swap
Size(MB): 2048
8、在LVM卷组中创建/
Mount Pont: /
将剩余空间分配给/
完成
这样分区的好处是可以支持磁盘动态扩容
操作系统安装完成后,开始定制服务:
关闭防火墙
service iptables stop
chkconfig iptables off
-------------
禁用selinux
在/etc/selinux/config修改SELINUX=disabled
-------------
openssl
通过yum安装openssl-1.0.1e版本,修复了heartbeat extension漏洞
openssl-1.0.1e-30.el6.8.x86_64.rpm
openssl-devel-1.0.1e-30.el6.8.x86_64.rpm
通过yum安装并下载(安装包都可以定制)
expect-5.44.1.15-5.el6_4.x86_64.rpm
glib2-2.28.8-4.el6.i686.rpm
glib2-2.28.8-4.el6.x86_64.rpm
libstdc++-4.4.7-11.el6.i686.rpm
libstdc++-4.4.7-11.el6.x86_64.rpm
lrzsz-0.12.20-27.1.el6.x86_64.rpm
openssl098e-0.9.8e-18.el6_5.2.i686.rpm
openssl098e-0.9.8e-18.el6_5.2.x86_64.rpm
zlib-1.2.3-29.el6.i686.rpm
zlib-1.2.3-29.el6.x86_64.rpm
上述rpm包存放在/root/packages
-------------
卸载系统自带java
rpm -qa|grep java|xargs rpm -e --nodeps
-------------
删除系统自带/etc/my.cnf
-------------
修改/boot/grub/grub.conf
在kernel中增加biosdevname=0参数,禁用dell服务器的网卡重命名等功能
-------------
上传扩容脚本,存放在/root/resize中
-------------
修改/etc/sysconfig/network-scripts/ifcfg-eth0中ONBOOT=yes
删除网卡相关信息,以防使用镜像安装时导致冲突:
删除/etc/sysconfig/network-scripts/ifcfg-eth0中HWADDR、IPADDR、NETMASK、GATEWAY、DNS1、UUID
删除/etc/udev/rules.d/70-persistent-net.rules
-------------
替换/etc/init.d/ntpd
chmod 755 /etc/init.d/ntpd
增加ntpd服务开机启动chkconfig ntpd on
启动ntpd:service ntpd start
-------------
升级bash修复注入漏洞
yum update -y bash
-------------
安装DenyHosts防止恶意破解
wget http://sourceforge.net/projects/denyhosts/files/denyhosts/2.6/DenyHosts-2.6.tar.gz
tar zxvf DenyHosts-2.6.tar.gz
cd DenyHosts-2.6
python setup.py install
cp daemon-control-dist /etc/init.d/daemon-control
service daemon-control restart
chkconfig daemon-control on
-------------
关闭打印服务
service cups stop
chkconfig cups off
-------------
开放rsyslog打印
取消下面四行的注释:
$ModLoad imudp
$UDPServerRun 514
$ModLoad imtcp
$InputTCPServerRun 514
保存并重启rsyslog:
service rsyslog restart
-------------
修改系统随机端口范围(范围可以定制)
vi /etc/sysctl.conf
增加一行
net.ipv4.ip_local_port_range = 25001 29999
保存并使之生效(reboot也可以生效)
/sbin/sysctl -p
........
定制完成之后,可以修改KS文件,或是使用操作系统镜像制作工具(如clonezilla等)来制作系统镜像。