centos 6.8 部署本地作为PXE服务器

前端之家收集整理的这篇文章主要介绍了centos 6.8 部署本地作为PXE服务器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  • http
# config for apache
<Directory />
    Options Indexes
    AllowOverride none
    order allow,deny
    allow from all
</Directory>


# dir privileges
chown -R apache:apache /var/www/html

# 打起来
service httpd restart
  • dhcp
# file: /etc/dhcp/dhcpd.conf

option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-cport code 3 = unsigned integer 16;
option PXE.mtftp-cport code 4 = unsigned integer 8;
option PXE.mtftp-cport code 5 = unsigned integer 8;
option arch code 93 = unsigned integer 16;


subnet 192.168.9.0 netmask 255.255.255.0 {
  range 192.168.9.100 192.168.9.200;
  option routers 192.168.9.1;
  default-lease-time 600;
  max-lease-time 1800;
  next-server 192.168.9.1;
  filename "pxelinux.0";
}

# 启动
service dhcpd restart
  • tftp
# 修改启动文件
/etc/xinetd.d/tftp

        disable                 = no


# 打起来
service xinetd restart

# 目录/var/lib/tftpboot
wget http://ojv12llai.bkt.clouddn.com/uploads/20170310170318.gz
放到 /var/www/html/ks.cfg

ks版本有两个,这里只是放出来一个吧, 最重要的是磁盘这块,下面的kickstart文件是两个50GB的磁盘, 做LVS, sda开始的200MB给boot, 10GB给swap,剩下的做LVM, sdb全部做LVM。

# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
url --url="http://192.168.9.1/"
#cdrom
lang zh_CN.UTF-8
keyboard us
#network --onboot no --device eth0 --bootproto dhcp --noipv6
network --onboot no --device eth1 --bootproto dhcp --noipv6
rootpw  --iscrypted $6$msOGDkogHYLHOWq7$M1Xo/UnwZoHvW6CJEojLa9N2d5kWNProLkIG1P3FgbjUV2MMmkfjrKDpTo5HXBErv.J.Uclf13Pf2aYH0s9MN.
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone Asia/Shanghai
bootloader --location=mbr --driveorder=sda,sdb --append="crashkernel=auto 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 --none
#clearpart --linux --drives=sda
#clearpart --linux --drives=sdb
clearpart --all
#volgroup VolGroup --pesize=4096 pv.008003 pv.008017
#logvol / --fstype=ext4 --name=LogVol00 --vgname=VolGroup --size=91952

part /boot --fstype=ext4 --asprimary --size=200 --ondisk=/dev/sda
part swap --size=10240 --ondisk=/dev/sda
part pv.008003 --grow --size=200 --ondisk=/dev/sda

part pv.008017 --grow --size=200 --ondisk=/dev/sdb

volgroup VolGroup --pesize=4096 pv.008003 pv.008017
logvol / --fstype=ext4 --name=LogVol00 --vgname=VolGroup --size=91952


#repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100

%packages
@base
@chinese-support
@console-internet
@core
@debugging
@directory-client
@java-platform
@MysqL-client
@network-file-system-client
@PHP
@performance
@perl-runtime
@postgresql-client
@server-platform
@server-policy
@turbogears
@web-server
@web-servlet
@workstation-policy
pax
python-dmidecode
oddjob
sgpio
device-mapper-persistent-data
samba-winbind
certmonger
pam_krb5
krb5-workstation
perl-DBD-sqlite
certmonger
perl-CGI
%end

猜你在找的CentOS相关文章