Installation
============

ZoneControl is a `Python <https://www.python.org/>`__
`Django <https://www.djangoproject.com/>`__ application and is provided
by PowerDNS in two different formats:

-  RPM package (for RedHat Enterprise Linux, CentOS, etc.)
-  DEB package (For Debian, Ubuntu, etc.)

These packages contain a Python `Virtual
Environment <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`__
(virtualenv) with all required Python dependencies.

Requirements
------------

As ZoneControl comes bundled with its dependencies, the only requirement
of the target system is a Python 3.4 or newer installation.

Installation using Ansible
--------------------------

PowerDNS will provide an `Ansible <https://ansible.com>`_ role to install ZoneControl and set up an initial user.
This role comes with a ``README`` file that describes all variables for the role.

This installation method is highly recommended over manual installations.

Manual Installation
-------------------

Installation on RPM-based Distributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

RedHat Enterprise Linux and CentOS, both version 6 and 7, provide Python
3.4 through `Extra Packages for Enterprise Linux
(EPEL) <https://fedoraproject.org/wiki/EPEL>`__.

To ensure this is installed as a dependency for ZoneControl, install the
``epel-release`` package::

    yum install epel-release

Should this installation fail, please refer to the EPEL website
mentioned above.

If PowerDNS provided a repository to use, add its configuration to
``/etc/yum.repos.d/pdns-zonecontrol.repo``:

.. code::

    [pdns-zonecontrol]
    baseurl = $URL_PROVIDED
    gpgcheck = 1
    gpgkey = $URL_TO_PUBLICKEY_PROVIDED
    name = PowerDNS ZoneControl Repository
    priority = 90

And install the package:

::

    yum install zonecontrol

If only the RPM file was supplied, install it through :program:`yum` as
follows:

::

    yum install zonecontrol-*.rpm

Installation on Debian-based Distributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Debian-based operating systems, the provided Python 3 is new enough to not require external repositories.

If a repository for ZoneControl is provided add the repository to ``/etc/apt/sources.d/zonecontrol`` and install ZoneControl::

    apt-get update && apt-get install zonecontrol

I only a .deb file is provided, install it::

    dpkg -i zonecontrol_$VERSION.deb

Post-installation
~~~~~~~~~~~~~~~~~

After the initial installation, ZoneControl needs to be configured. See
the `Configuration <#configuration>`__ section on how to configure.

After configuration, the database needs to be populated, run:

::

    zonecontrol-manage migrate

Now create a superuser (if required):

::

    zonecontrol-manage createsuperuser
