树莓派安装cobbler,自动化安装CentOS

安装python、相关python模块、apache

sudo apt-get install python python2.7 python-django python-netaddr python-yaml python-simplejson python-cheetah python-libvirt python-urlgrabber apache2 libapache2-mod-wsgi make

 

开启apache的proxy模块

a2enmod proxy proxy_http

 

安装cobbler、cobbler-web

树莓派官方系统软件源中无cobbler,所以不能使用apt-get install cobbler来安装cobbler。需要下载cobbler的源代码自行编译安装。

wget https://github.com/cobbler/cobbler/archive/v2.8.2.tar.gz

tar -xzvf v2.8.2.tar.gz

cd cobbler-2.8.2

make

make install

 

为cobbler.conf、cobbler_web创建软链接

ln -s /etc/apache2/conf-available/cobbler.conf /etc/apache2/conf-enabled/cobbler.conf

ln -s /etc/apache2/conf-available/cobbler_web.conf /etc/apache2/conf-enabled/cobbler_web.conf

 

编辑自己的kickstart启动脚本

 

cobbler的脚本等存放于路径

/var/lib/cobbler

 

cobbler的kickstarts脚本需放置在

/var/lib/cobbler/kickstarts

 

一切都安装妥当之后,cobbler_web 跑不起来,报"500 Internal Server Error" 错误,查看apache错误日志

tail /var/log/apache2/error.log

可以看到相关错误提示为ImproperlyConfigured: The SECRET_KEY setting must not be empty。

意思是说SECRET_KEY不应该为空,查看设置文件

cat /usr/local/share/cobbler/web/settings.py

找到下面这行,可以看到value为空。

SECRET_KEY = ''

设置安全性高的key,参考http://www.jb51.net/article/86119.htm ,可以使用简单纯文本应急。

 

网上有大量关于cobbler的资料,就不详细写了

 

posted @ 2017-11-02 08:50  sherlock-merlin  阅读(708)  评论(0编辑  收藏  举报