您的位置:首页 > 编程语言 > PHP开发

Ubuntu Server 12.04下Cobbler + DNSmasq +tftpd-hpa的安装配置

2016-12-28 20:29 232 查看

通过Cobbler 可以用来快速建立 Linux 网络安装环境。

一、安装cobbler软件

网络环境及安装计划
网关服务器:硬件路由,192.168.88.2
域名服务器:dnsmasq程序,192.168.88.253
DHCP服务器:dnsmasq 程序,192.168.88.253 动态地址范围192.168.88.100-254
tFTP服务器:tfpd-hpa程序,192.168.88.253
cobbler服务器:192.168.88.253

1. 安装cobbler和cobbler-web
其中cobbler-web,是cobbler的web接口,可以通过它来使cobbler操作形象。
# sudo apt-get install cobbler cobbler-web
建议把debmirror 和createrepo也一并安装好了。其中debmirror是用来建立Debinan系统镜像源的工具,而createrepo是用来建立RedHat系列镜像源的工具。
安装完成后,cobbler和apache的服务都会启动。
2. 检查安装cobbler结果
在这里我用curl小工具来测试
# curl -I 192.168.88.253/cobbler/
HTTP/1.1 200 OK
Date: Fri, 01 Nov 2013 19:24:07 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Content-Type: text/html;charset=UTF-8
返回200OK就说明工作正常了。
3. 初步配置cobbler
3.1 检查配置是否正确
运行cobbler check检查配置
# sudo cobbler check
The following are potential configuration items that you may want to fix:
1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
Restart cobblerd and then run 'cobbler sync' to apply changes.
根据上面的提示修复错误。
# sudo apt-get install debmirror
同时配置debmirror
生成/etc/debmirror.conf配置文件
# cp /usr/share/doc/debmirror/examples/debmirror.conf /etc/
修改/etc/debmirror.conf配置文件
注释掉@dists和@arches两行
# vi /etc/debmirror.conf
...
#@dists="sid";
@sections="main,main/debian-installer,contrib,non-free";
#@arches="i386";
...
使配置生效
# sudo cobbler sync
task started: 2013-11-02_033214_sync
task started (id=Sync, time=Sat Nov  2 03:32:14 2013)
running pre-sync triggers
cleaning trees
mkdir: /var/lib/tftpboot/pxelinux.cfg
mkdir: /var/lib/tftpboot/grub
mkdir: /var/lib/tftpboot/images
mkdir: /var/lib/tftpboot/s390x
mkdir: /var/www/cobbler/rendered
mkdir: /var/lib/tftpboot/ppc
mkdir: /var/lib/tftpboot/etc
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /usr/lib/syslinux/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /usr/lib/syslinux/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /usr/lib/syslinux/chain.c32 -> /var/lib/tftpboot/chain.c32
trying hardlink /boot/memtest86+_multiboot.bin -> /var/lib/tftpboot/images/memtest86+_multiboot.bin
trying hardlink /boot/memtest86+.bin -> /var/lib/tftpboot/images/memtest86+.bin
trying hardlink /usr/lib/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying distros to tftpboot
copying images
generating GPXE/PXE configuration files
generating PXE menu structure
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running Python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
重新检查配置
# sudo cobbler check           
No configuration problems found.  All systems go.
4.  配置cobbler web
安装好cobbler web后,默认的访问信息如下,
URL:http://<Chostname>/cobbler_web
用户名:cobbler
密码:cobbler
apache配置文件:/etc/apache2/conf.d/cobbler_web.conf
出于安全考虑,可以通过htdigest命令来修改用户cobbler的密码。
# htdigest /etc/cobbler/users.digest "Cobbler" cobbler
Changing password for user cobbler in realm Cobbler
New password:
Re-type new password:
使配置生效
以后我们也可以随时通过cobbler sync来重新加载配置文件。
# cobbler sync
task started: 2013-11-02_034250_sync
task started (id=Sync, time=Sat Nov  2 03:42:50 2013)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/memtest86+_multiboot.bin
removing: /var/lib/tftpboot/images/memtest86+.bin
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /boot/memtest86+_multiboot.bin -> /var/lib/tftpboot/images/memtest86+_multiboot.bin
trying hardlink /boot/memtest86+.bin -> /var/lib/tftpboot/images/memtest86+.bin
copying distros to tftpboot
copying images
generating GPXE/PXE configuration files
generating PXE menu structure
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

cobbler web登录界面

cobbler web界面

更多详情见请继续阅读下一页的精彩内容http://www.linuxidc.com/Linux/2013-11/92573p2.htm

相关阅读

Linux运维工程师笔试题 http://www.linuxidc.com/Linux/2013-09/90621.htm

运维自动化之Cobbler安装配置 http://www.linuxidc.com/Linux/2013-03/81575.htm

RHEL5.5下Cobbler的配置 http://www.linuxidc.com/Linux/2013-06/86115.htm

运维自动化部署Cobbler之服务安装篇 http://www.linuxidc.com/Linux/2013-02/80133.htm

利用Cobbler批量快速网络安装CentOS http://www.linuxidc.com/Linux/2012-12/75838.htm

CentOS 6.3上安装部署 Cobbler http://www.linuxidc.com/Linux/2012-10/72094.htm

DNSmasq 的详细介绍请点这里
DNSmasq 的下载地址请点这里

Ubuntu 10.10下DNSmasq和Named似有冲突 http://www.linuxidc.com/Linux/2010-12/30338.htm

Ubuntu 8.10下使用DNSmasq提供DNS和DHCP服务 http://www.linuxidc.com/Linux/2008-12/17589.htm

用DNSmasq搭建小型的内网DNS http://www.linuxidc.com/Linux/2013-04/82073.htm

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: