使用PXE+Dhcp+Apache+KickStart进行无人值守安装RHEL 5.9

简介:

使用PXE+Dhcp+Apache+KickStart进行无人值守安装RHEL 5.9

一、yum需要配置好 
vim /root/yumresoure.sh 
#!/bin/bash

[ -d /data/yum/ ] || mkdir -p /data/yum/
mv   /etc/yum.repos.d/* /data/yum/
rm -rf /etc/yum.repos.d/*
echo [rhel-data] >/etc/yum.repos.d/rhel-source.repo
echo name=RHEL5 data >> /etc/yum.repos.d/rhel-source.repo
echo baseurl=file:///media/Server >>/etc/yum.repos.d/rhel-source.repo
echo enabled=1 >> /etc/yum.repos.d/rhel-source.repo
echo gpgcheck=0 >> /etc/yum.repos.d/rhel-source.repo

vim /root/yum.sh 
#!/bin/bash
umount /dev/cdrom
mount /dev/cdrom  /media

bash /root/yumresoure.sh 
bash /root/yum.sh 

二、安装kickstart服务
yum install -y system-config-kickstart.noarch 
system-config-kickstart

wKiom1RtaArjTRL2AALasRqRltI448.jpg

wKioL1RtaIOyK7AEAAIMynvUQe4540.jpg

wKiom1RtaAuirZBPAAI8iV0z3BY381.jpg

wKioL1RtaIOAV4uRAAJ_xNRfiZs457.jpg

wKioL1RtaIOwuGV7AAJi0UKRwzE223.jpg

wKiom1RtaAuh0189AAIOsP2VRZE287.jpg

wKioL1RtaITQooJ7AAH_LTRMot0959.jpg

wKiom1RtaAyy72CiAAIV9QcaGmU494.jpg

wKioL1RtaITy2y1KAAI5npN7_EE818.jpg

wKiom1RtaAzyj_RjAAJ182dYj-w053.jpg

wKioL1RtaISS9020AAJzBW7_oUc514.jpg

wKiom1RtaAyA0kkfAALKFoWBbXg633.jpg

wKioL1RtaIWSpLtLAAJr8XvQc3k037.jpg

wKiom1RtaA3heytKAALRhc5_nRo229.jpg

wKiom1RtaA3Tnrb9AAHR5mMlG2g876.jpg

wKioL1RtaIWRteOmAAHycAR_qY4844.jpg

wKioL1RtaIbzvt59AAIFhpKctnM637.jpg

三、安装httpd服务
yum install -y httpd

mkdir /var/www/html/rhel5.9
cp -r /media/* /var/www/html/rhel5.9/
cp /root/ks.cfg /var/www/html/rhel5.9/

vim /var/www/html/rhel5.9/ks.cfg

#platform=x86, AMD64, 或 Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
key --skip
# 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 --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# Installation logging level
logging --level=info
# Use network installation
url --url=http://10.10.10.30/rhel5.9
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$sa5Wf6oW$lEyPJJwDZ/zAJ2UK83Elp/

# SELinux configuration
selinux --disabled
# System timezone
timezone --isUtc Asia/Shanghai
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --defaultdesktop=GNOME --depth=8 --resolution=800x600
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=1024
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1

%packages
@dialup
@base
@gnome-desktop
@system-tools
@development-tools
@kde-software-development
@x-software-development
@gnome-software-development
@base-x
@admin-tools
@development-libs
@graphical-internet
@chinese-support
@legacy-software-development
@legacy-software-support
@java-development
@text-internet
@java
@editors
@ruby


四、安装xinetd和tftp服务
vim /etc/xinetd.d/tftp
yum install -y tftp xinetd
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no           ####默认是yes,需修改为no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
cp /usr/share/syslinux/pxelinux.0 /tftpboot/
cp /media/images/pxeboot/initrd.img /tftpboot/
cp /media/images/pxeboot/vmlinuz  /tftpboot/
cp /media/isolinux/*.msg   /tftpboot/
mkdir  pxelinux.cfg
cp /media/isolinux/isolinux.cfg  /tftpboot/pxelinux.cfg/isolinux.cfg
mv  /tftpboot/pxelinux.cfg/isolinux.cfg  /tftpboot/pxelinux.cfg/default
vim /tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 60
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://10.10.10.30/rhel5.9/ks.cfg

五、安装dhcpd服务
yum install -y dhcpd
cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf 
vim /etc/dhcpd.conf 
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample  
#
ddns-update-style interim;
ignore client-updates;
next-server 10.10.10.30;
filename "/pxelinux.0";
subnet 10.10.10.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  10.10.10.30;
        option subnet-mask              255.255.255.0;

#       option nis-domain               "domain.org";
#       option domain-name              "domain.org";
#       option domain-name-servers      192.168.1.1;

        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#       option netbios-node-type 2;

        range dynamic-bootp 10.10.10.200 10.10.10.240;
        default-lease-time 21600;
        max-lease-time 43200;


        # we want the nameserver to appear at a fixed address
#       host ns {
#               next-server marvin.redhat.com;
#               hardware ethernet 12:34:56:78:AB:CD;
#               fixed-address 207.175.42.254;
#       }
}

六、重启各项服务
/etc/init.d/xinetd restart
/etc/init.d/httpd  restart 
/etc/init.d/dhcpd  restart 


      本文转自独弹古调  51CTO博客,原文链接:http://blog.51cto.com/hunkz/1580020,如需转载请自行联系原作者






相关文章
|
1月前
|
网络安全 Apache
Apache服务器安装SSL证书
Apache服务器安装SSL证书
41 0
|
1月前
|
Apache PHP
Windows11 安装Apache24全过程
Windows11 安装Apache24全过程
174 0
|
8天前
|
安全 Java 测试技术
Windows电脑安装Apache JMeter的详细教程
本文介绍了在Windows上安装Apache JMeter的步骤。首先,需确保安装Java JDK并配置环境变量。然后,从JMeter官网下载ZIP文件,解压至指定目录,并同样配置JMeter的环境变量。验证安装成功后,可通过命令行以GUI或非GUI模式启动JMeter,进行性能测试。
27 0
|
22小时前
|
Java 应用服务中间件 Apache
安装和配置Apache Tomcat是部署Java Web应用程序的常见任务
安装和配置Apache Tomcat是部署Java Web应用程序的常见任务
14 7
|
1月前
|
Linux Apache
Centos7 安装Apache
安装Apache的步骤
51 6
|
16天前
|
Apache Windows
windows 一键安装apache服务器 windows傻瓜式安装apache2 web服务器管理软件
windows 一键安装apache服务器 windows傻瓜式安装apache2 web服务器管理软件
|
16天前
|
Apache Windows
apache2 安装时报错 ServerRoot must be a valid directory
apache2 安装时报错 ServerRoot must be a valid directory
|
16天前
|
Apache Windows
windows源码安装apache2 win安装apache 阿帕奇服务器
windows源码安装apache2 win安装apache 阿帕奇服务器
|
1月前
|
弹性计算 Shell Apache
一键安装apache脚本
【4月更文挑战第30天】
24 1
|
1月前
|
存储 Linux 数据库
ZooKeeper【搭建 01】apache-zookeeper-3.6.2 单机版安装+配置+添加到service服务+开机启动配置+验证+chkconfig配置(一篇入门zookeeper)
【4月更文挑战第8天】ZooKeeper【搭建 01】apache-zookeeper-3.6.2 单机版安装+配置+添加到service服务+开机启动配置+验证+chkconfig配置(一篇入门zookeeper)
53 0

推荐镜像

更多