centos6.3配置 kickstart   無人值守安裝centos6.3系統 httpd方式

centos6.3+tftp+dhcp+httpd

系統環境:centos6.3*64

 setenforce 0  關閉 selinux

service iptables stop  關閉iptables

1  掛載鏡像

mount /dev/cdrom /mnt

cp -rf   /mnt/*   /var/www/html/

 yum install -y httpd* tftp-server-* xinetd-* system-config-kickstart-* syslinux dhcp*  安裝必備軟件

配置tftp加載文件

vim /etc/xinetd.d/tftp


service tftp


{


socket_type            = dgram


protocol                = udp


wait                    = yes


user                    = root


server                  = /usr/sbin/in.tftpd


server_args            = -s /tftpboot    #開機必需的程序路徑(根據的tftpboot路徑更改)


disable                = yes      #把這邊的yes改爲no


per_source              = 11


cps                    = 100 2


flags                  = IPv4


}


mkdir /tftpboot

2  創建tftp目錄

cp /usr/share/syslinux/pxelinux.0 /tftpboot/


cp /mnt/images/pxeboot/initrd.img /tftpboot/


cp /mnt/images/pxeboot/initrd.img /tftpboot/


cp /mnt/isolinux/*.msg /tftpboot/      #開機引導文件


mkdir /tftpboot/pexlinux.cfg


cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

拷貝相關文件



3  配置 DHCP server




vim /etc/dhcp/dhcpd.conf

ddns-update-style interim;

ignore client-updates;

next-server 192.168.1.4;  #tftp server 的ip地址

filename "/pxelinux.0";

subnet 192.168.1.0 netmask 255.255.255.0 {

option routers          192.168.1.1;#路由地址

option subnet-mask      255.255.255.0;

range dynamic-bootp 192.168.1.50 192.168.1.100;

default-lease-time 21600;

max-lease-time 43200;

}

vim /etc/httpd/conf/httpd.conf


找到 #ServerName www.example.com:80 這一行 ,把註釋去掉


4 配置ks.cfg

桌面環境 運行命令 system-config-kickstart  配置ks.cfg 並拷貝到 /var/www/html 下

修改 ks.cfg

例子如下

#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.1.4/"
# Root password
rootpw --iscrypted $1$e8wRnTe1$eaeL5kK6Zi8MllGrUtCNk.
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
reboot
# System timezone
timezone  Asia/Shanghai
# Network information
network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=256
part / --fstype="ext4" --size=10000
part /usr/local --fstype="ext4" --size=10000
%packages

chmod -R 777 /tftpboot/


vim /tftpboot/pxelinux.cfg/default



 

default linux
prompt 0
timeout 10
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 ks=http://192.168.1.4/ks.cfg   #http地址,可以通過web訪問驗證
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img
label local
  localboot 1
label memtest86
  kernel memtest
  append -




啓動服務


 service httpd restart 

service xinetd restart

service dhcpd restart

chkconfig httpd on

chkconfig xinetd on

chkconfig dhcpd on


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章