歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Cobbler全自動安裝CentOS

Cobbler全自動安裝CentOS

日期:2017/2/28 14:37:46   编辑:Linux教程

環境:
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

Copyright © Linux教程網 All Rights Reserved