设置防火墙
/etc/init.d/iptables stop
挂载 ISO
mkdir /mnt/iso
mount /dev/cdrom /mnt/iso
DHCP设置
yum -y install dhcpd
vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
class "pxeclients"{
match if substring(option vendor-class-identifier,0,9) = "PXEClient";
filename "/pxelinux.0";
next-server 192.168.10.1;
}
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
option domain-name "joindata.net";
option domain-name-servers 61.177.7.1;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.10.10 192.168.10.100;
default-lease-time 21600;
max-lease-time 43200;
}
service dhcpd start
chkconfig dhcpd on
yum -y install tftp-server syslinux xinetd
chkconfig tftp on
service xinetd start
[root@localhost ~]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
[root@localhost ~]# cp /usr/lib/syslinux/menu.c32 /tftpboot/
[root@localhost ~]# cp /usr/lib/syslinux/memdisk /tftpboot/
[root@localhost ~]# cp /usr/lib/syslinux/mboot.c32 /tftpboot/
[root@localhost ~]# cp /usr/lib/syslinux/chain.c32 /tftpboot/
mkdir /tftpboot/pxelinux.cfg
cp /mnt/iso/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
cp /mnt/iso/isolinux/* /tftpboot/
yum install nfs-utils portmap
cat /etc/exports
/mnt/cdrom 192.168.10.0/24(ro,sync)
service portmap start
service nfs start
apache
yum -y install httpd
service httpd start
mkdir -p /var/www/html/centos/5.5/i386/
mount /dev/cdrom /var/www/html/centos/5.5/i386/
yum -y install vsftpd
/etc/init.d/vsftpd start
chkconfig vsftpd on
mkdir -p /var/ftp/pub/centos/5.5/i386/
mount /dev/cdrom /var/ftp/pub/centos/5.5/i386/
/etc/vsftpd/vsftpd.conf
vi /etc/vsftpd/vsftpd.conf
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
idle_session_timeout=600data_connection_timeout=120ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to joindata's FTP service.
pam_service_name=vsftpd
listen=yes
选择http方式安装
修改default 文件
vi /tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
#append initrd=initrd.img
#append initrd=initrd.img ks=nfs:192.168.10.1:/mnt/iso/ks.cfg
#append initrd=initrd.img ks=ftp://192.168.10.1/pub/ks.cfg
append initrd=initrd.img ks=http://192.168.10.1/centos/5.5/i386/ks.cfg
label text
kernel vmlinuzkernel vmlinuz
append initrd=initrd.img text
label ks
kernel vmlinuz
append ks initrd=initrd.img
label local
localboot 1
label memtest86
kernel memtest
append -
创建 ks.cfg 文件
vi /var/www/html/centos/5.5/i386/ks.cfg
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --enabled --http --ssh --trust=eth0
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use network installationurl --url=http://192.168.10.1/centos/5.5/i386
# Network information
#network --bootproto=static --device=eth0 --gateway=192.168.10.1 --ip=192.168.10.12 --nameserver=61.177.7.1
--netmask=255.255.255.0 --onboot=on
network --bootproto=dhcp --device=eth0 --onboot=on
#Root password
rootpw --iscrypted $1$aGibcMp0$nCXrkKYm5DKwX2Sw0n59C1
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=1024
part / --asprimary --bytes-per-inode=4096 --fstype="ext3" --size=7000
reboot
%packages
@base
@development-libs
@development-tools
@chinese-support
设置完成即可