服务器IP为192.168.88.253,可以给192.168.88.0/24网段的机器安装 RHEL5.9系统
分别给每台客户端分配主机名,格式如下
stationx.tarena.com 192.168.88.x
安装所需要的软件包存放在/data/rhel5.9
通过Kickstart实现无人值守安装
[root@localhost ~]# cat/etc/sysconfig/network-scripts/if。。。-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0c:29:72:31:29
IPADDR=192.168.88.253
NETMASK=255.255.255.0
[root@localhost ~]# service network restart
[root@localhost ~]# chkconfig network on
步骤1、搭建DHCP服务器
1、安装软件包
先配置yum库
[root@localhost ~]# cat /etc/yum.repos.d/yang.repo
[rhel.yy.server]
name=Red Hat Enterprise Linux yy
baseurl=file:///misc/cd/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@localhost ~]# yum -y install dhcp
2、修改dhcpd主配置文件
[root@localhost ~]# cat /etc/dhcpd.conf
ddns-update-style interim;
next-server 192.168.88.253;
filename "pxelinux.0";
subnet 192.168.88.0 netmask 255.255.255.0 {
optionsubnet-mask 255.255.255.0;
optiondomain-name "tarena.com";
option domain-name-servers 192.168.88.253;
range dynamic-bootp 192.168.88.168 192.168.88.188;
default-lease-time21600;
max-lease-time43200;
}
3、启动dhcpd服务
[root@localhost ~]# service dhcpd restart
启动 dhcpd: [确定]
[root@localhost ~]# chkconfig dhcpd on
步骤2、配置vftp
[root@localhost ~]# yum -y install tftp-server
[root@localhost ~]# vim /etc/xinetd.d/tftp
...
13 server_args = -s /tftpboot
14 disable = no
...
[root@localhost ~]# service xinetd restart
[root@localhost ~]# chkconfig xinetd on
[root@localhost ~]# cd /misc/cd/images/pxeboot/
[root@localhost pxeboot]# ls
initrd.img README TRANS.TBL vmlinuz
[root@localhost pxeboot]# cp initrd.img vmlinuz /tftpboot/
[root@localhost pxeboot]# cp /usr/share/syslinux/pxelinux.0 /tftpboot/
[root@localhost pxeboot]# mkdir /tftpboot/pxelinux.。。。
[root@localhost pxeboot]# cp /misc/cd/isolinux/isolinux.。。。
/tftpboot/pxelinux.。。。/default
步骤3、搭建NFS网络共享
1)安装软件包。
[root@localhost~]# rpm -q nfs-utils portmap
nfs-utils-1.0.9-66.el5
portmap-4.0-65.2.2.1
2)创建共享文件夹。
[root@localhost~]# mkdir -p /data/iso/rhel5.9
3) 将光盘中的文件拷贝到共享文件夹。
[root@localhost~]# cp -rf /misc/cd/* /data/iso/rhel5.9/
4)修改主配置文件。
[root@localhost~]# cat /etc/exports
/data/iso/rhel5.9 *(ro)
4) 重启服务,并设置随开机启动。
[root@localhost~]# service portmap restart
停止 portmap: [确定]
启动 portmap: [确定]
[root@localhost~]# service nfs restart
关闭 NFS mountd: [失败]
关闭 NFS 守护进程: [失败]
关闭 NFSquotas: [失败]
启动 NFS 服务: [确定]
关掉 NFS 配额: [确定]
启动 NFS 守护进程: [确定]
启动 NFSmountd: [确定]
StoppingRPC idmapd: [确定]
正在启动RPC idmapd: [确定]
[root@localhost~]# chkconfig portmap on
[root@localhost~]# chkconfig nfs on
步骤4、配置DNS服务器
1、安装软件包
[root@localhost ~]# yum -y install bind bind-chrootcaching-nameserver
2、修改dns主配置文件
[root@localhost ~]# cd /var/named/chroot/etc
[root@localhost etc]# ls
localtime named.caching-nameserver.conf named.rfc1912.zones rndc.key
[root@localhost etc]# cp -p named.caching-nameserver.confnamed.conf
[root@localhost etc]# vim named.conf
...
15 listen-on port 53 { 192.168.88.253; };
...
27 allow-query { any; };
28 allow-query-cache { any; };
...
37 match-clients { any; };
38 match-destinations { any; };
[root@localhost etc]# vim named.rfc1912.zones
...
51 zone"tarena.com" IN {
52 type master;
53 file "tarena.com.zone";
54 };
55
56 zone "88.168.192.in-addr.arpa"IN {
57 type master;
58 file "tarena.com.arpa";
59 };
[root@ser1 etc]# named-checkconf named.conf
[root@localhost ~]# cd /var/named/chroot/var/named/
[root@localhost named]# ls
data localhost.zone named.ca named.local slaves
localdomain.zone named.broadcast named.ip6.local named.zero
[root@localhost named]# cp -p named.local tarena.com.zone
[root@localhost named]# cp -p named.local tarena.com.arpa
[root@localhost named]# cat tarena.com.zone
$TTL 86400
@ IN SOA localhost. root.localhost. (
201404181701 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400) ; Minimum
IN NS dns1.tarena.com.
dns1 IN A 192.168.88.253
$GENERATE 168-188 station$ IN A192.168.88.$
[root@localhost named]# cat tarena.com.arpa
$TTL 86400
@ IN SOA localhost. root.localhost. (
201404181701 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400) ; Minimum
IN NS dns1.tarena.com.
253 IN PTR dns1.tarena.com.
$GENERATE 168-188 $ IN PTRstation$.tarena.com.
[root@localhost named]# named-checkzone tarena.comtarena.com.zone
zone tarena.com/IN: loaded serial 2014041915
OK
[root@localhost named]# named-checkzone tarena.comtarena.com.arpa
zone tarena.com/IN: loaded serial 2014041915
OK
3、启动服务
[root@localhost named]# service named restart
停止 named: [确定]
启动 named: [确定]
[root@localhost named]# chkconfig named on
步骤4、通过Kickstart实现无人值守安装
1、安装软件包
[root@localhost named]# yum -y install system-config-kickstart
[root@localhost ~]# system-config-kickstart
[root@localhost ~]# yum -y install system-config-kickstart
操作过程见图片
[root@localhost ~]# yum -y install httpd
[root@localhost ~]# cp /root/ks.。。。 /var/www/html/
[root@localhost ~]# service httpd restart
[root@localhost ~]# chkconfig httpd on
[root@localhost ~]# vim /var/www/html/ks.。。。
在文件中添加key --skip
修改default选项
[root@localhost ~]# cd /tftpboot/pxelinux.。。。/
[root@localhost pxelinux.。。。]# ls
default
[root@localhost pxelinux.。。。]# vim default
18 appendks=http://192.168.88.253/ks.。。。 initrd=initrd.img