81921531 2013-12-15
环境:
OEL6.3 x64 (CentOS6.3 x64)
网络环境中无其它DHCP服务器
一、 cobbler安装准备
1. 关闭iptables与selinux
# chkconfig iptables off
# vi /etc/selinux/config
SELINUX=disabled
1 # sestatus 重启后查看
2. 安装源准备并安装cobbler软件
说明:基础源与epel源。
rpm -ivh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install cobbler cobbler-web httpd rsync tftp-server xinetd dhcp Python-ctypes debmirror pykickstart fence-agents
二、 配置tftp-server与rsync
开启tftp与rsync服务
sed -i '/disable/c disable = no' /etc/xinetd.d/tftp
sed -i -e 's/= yes/= no/g' /etc/xinetd.d/rsync
三、配置cobbler
1. 配置httpd配置文件
# vi /etc/httpd/conf/httpd.conf
ServerName 127.0.0.1:80
2. 配置cobbler主配置文件
sed -i 's/next_server: 127.0.0.1/next_server: 192.168.1.10/g' /etc/cobbler/settings
sed -i 's/server: 127.0.0.1/server: 192.168.1.10/g' /etc/cobbler/settings
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings
sed -i 's/manage_rsync: 0/manage_rsync: 1/g' /etc/cobbler/settings
3. 配置cobbler web登录认证配置文件
(1) 修改认证文件
sed -i 's/module = authn_denyall/module = authn_configfile/g' /etc/cobbler/modules.conf
(2) 设置用户名密码:
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
4. 生成Cobbler安装系统root初始密码
(1)这里生成密钥和配置默认密钥,ks文件引用
# openssl passwd -1 -salt 'random-phrase-here' '111111'
$1$random-p$WbZ3JxhRzCS/1Ne4S9g4Z.
(2) 将上面的加密串加入cobbler配置文件中。
# vi /etc/cobbler/settings
# 修改为如下配置
default_password_crypted: "$1$random-p$WbZ3JxhRzCS/1Ne4S9g4Z."
四、配置DHCP与启动cobbler相关服务
1. 配置dhcp配置文件
# mv /etc/cobbler/dhcp.template /etc/cobbler/dhcp.template.bak
# vi /etc/cobbler/dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option domain-name-servers 202.100.192.68;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.120 192.168.1.254;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
2. 需要启动的服务
chkconfig httpd on
chkconfig xinetd on
chkconfig dhcpd on
chkconfig cobblerd on
service httpd start
service xinetd start
service dhcpd start
service cobblerd start
相关阅读: