Installing Cobbler 2.6.11 on Ubuntu 16.04


As it took me a bit to figure out, I'll quickly show in this tutorial how to install the latest version of Cobbler on Ubuntu. It may work in a quite similar way also on other linux distributions.

First install the prerequisites:
apt-get update
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 needs the proxy module enabled:
a2enmod proxy proxy_http

Now download cobbler and install it:
wget https://github.com/cobbler/cobbler/archive/v2.6.11.tar.gz
tar -xvpf v2.6.11.tar.gz 
cd cobbler-2.6.11/
make
make install

Activate the cobbler apache integration:
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

This fixes a weird bug which later on would launch some nasty exception:
ln -s /usr/local/lib/python2.7/dist-packages/cobbler /usr/lib/python2.7/dist-packages/

Then edit /usr/local/share/cobbler/web/cobbler.wsgi and replace those lines:
import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()

with these:
from django.core.wsgi import get_wsgi_application
_application = get_wsgi_application()

You'll find them in the last few lines of the file. This also will prevent a nasty exception.

Now edit /usr/local/share/cobbler/web/settings.py and find the line starting with SECRET_KEY = ''.
Put a unique key in between the quotes.

Now create the cobbler user login:
htdigest /etc/cobbler/users.digest "Cobbler" cobbler 
You will be asked to enter a password. You will later login to the web interface with username cobbler and this password.

Reboot your server!

/etc/init.d/cobblerd start
/etc/init.d/apache2 start

I recommend you to run "cobbler check" in order to fine-tune your installation. Point your browser to your server: http://<server>/cobbler_web