pxe远程安装linux原理及详细步骤(2)

来源:互联网 发布:小米抢购技巧知乎 编辑:程序博客网 时间:2024/05/16 06:36
4,创建ks.cfg文件,文件内容如下,红色为修改部分

[root@localhost ~]# vi ks.cfg 

cdrom

# Kickstart file automatically generated by anaconda.

install

url --url=http://10.1.1.1

lang zh_CN.UTF-8

keyboard us

xconfig --startxonboot

network --device eth0 --bootproto dhcp

network --device eth1 --bootproto static --ip 10.1.1.1 --netmask 255.255.255.0

rootpw --iscrypted $1$GOol57Yb$hvgsCek.rbBuGw2qIOvrF/

firewall --enabled --port=22:tcp

authconfig --enableshadow --enablemd5

selinux --enforcing

timezone --utc Asia/Shanghai

bootloader --location=mbr --driveorder=sda --append="rhgb quiet"

# The following is the partition information you requested

# Note that any partitions you deleted are not expressed

# here so unless you clear all partitions first, this is

# not guaranteed to work

clearpart --linux --drives=sda

part /boot --fstype ext3 --size=100 --ondisk=sda

part pv.2 --size=0 --grow --ondisk=sda

volgroup VolGroup00 --pesize=32768 pv.2

logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow

logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=256 --grow --maxsize=512

reboot

%packages

@base

@chinese-support

@core

@dns-server

@dialup

@editors

@games

@graphical-internet

@graphics

@kde-desktop

@office

@sound-and-video

@text-internet

@web-server

@base-x

keyutils

trousers

"ks.cfg" 54L, 1315C written

重启xinetd服务,并且启动httpd服务,打开一个网页输入你服务器(CentOS1)的IP地址,显示apache的主页,好的配置没有问题,下一步。。。

5,复制文件

[root@localhost ~]# cd /etc/httpd/conf.d/

[root@localhost conf.d]# ls

manual.conf  perl.conf  php.conf  proxy_ajp.conf  python.conf  README  squid.conf  ssl.conf  webalizer.conf  welcome.conf

[root@localhost conf.d]# rm welcome.conf 

[root@localhost conf.d]# cd /misc/cd    

[root@localhost cd]# cp -r * /var/www/html           //拷贝cd下的所有文件

[root@localhost cd]# cp /root/ks.cfg /var/www/html/     //拷贝做好的ks.cfg

重启服务httpd,刷新浏览器,是不是看到可以看到/var/www/html/中的所有文件了。

该实验需要启动的3个服务:xinetdhttpddhcpd

6一切ok,新建一台机器吧,从网卡启动,把cd等没用的都删掉,省的占用资源

另外,需要设置/var/www/html/下的ks.cfg的权限改为666

[root@localhost cd]# chmod 666 /var/www/html/ks.cfg