]> Installation
Packages Some operating systems or software package vendors may provide ready-to-use, pre-built software packages for Kea. Installing a pre-built package means you do not need to install build-only prerequisites and do not need to make the software. FreeBSD ports, NetBSD pkgsrc, and Debian testing package collections provide all the prerequisite packages.
Install Hierarchy The following is the directory layout of the complete Kea installation (all directories paths are relative to the installation directory): etc/kea/ — configuration files. include/ — C++ development header files. lib/ — libraries. sbin/ — server software and commands used by the system administrator. share/kea/ — configuration specifications and examples. share/doc/kea/ — this guide, other supplementary documentation, and examples. share/man/ — manual pages (online documentation). var/kea/ — server identification, lease databases, and log files.
Building Requirements In addition to the run-time requirements (listed in ), building Kea from source code requires various development include headers and program development tools. Some operating systems have split their distribution packages into a run-time and a development package. You will need to install the development package versions, which include header files and libraries, to build Kea from the source code. Building from source code requires the following software installed on the system: Boost build-time headers (). At least Boost version 1.35 is required. When header-only Boost error code is not available or wanted, the Boost system library is required too. Botan (at least version 1.8) or OpenSSL. log4cplus (at least version 1.0.3) development include headers. A C++ compiler and standard development headers. Kea builds have been tested with GCC g++ 3.4.3, 4.1.2, 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10. The development tools "make". Visit the user-contributed wiki at for system-specific installation tips.
Installation from Source Kea is open source software written in C++. It is freely available in source code form from ISC as a downloadable tar file or via Kea Git code revision control service. (It may also be available in pre-compiled ready-to-use packages from operating system vendors.)
Download Tar File The Kea release tarballs may be downloaded from: (using FTP or HTTP).
Retrieve from Git Downloading this "bleeding edge" code is recommended only for developers or advanced users. Using development code in a production environment is not recommended. When building from source code retrieved via Git, additional software will be required: automake (v1.11 or later), libtoolize, and autoconf (2.59 or later). These may need to be installed. The latest development code (together with temporary experiments and un-reviewed code) is available via the Kea code revision control system. This is powered by Git and all the Kea development is public. The leading development is done in the master branch. The code can be checked out from git://git.kea.isc.org/kea: $ git clone git://git.kea.isc.org/kea The code checked out from the git repository doesn't include the generated configure script, Makefile.in files, nor their related build files. They can be created by running autoreconf with the switch. This will run autoconf, aclocal, libtoolize, autoheader, automake, and related commands.
Configure before the build Kea uses the GNU Build System to discover build environment details. To generate the makefiles using the defaults, simply run: $ ./configure Run ./configure with the switch to view the different options. Some commonly-used options are: --prefix Define the installation location (the default is /usr/local). --with-boost-include Define the path to find the Boost headers. --with-boost-libs Specify Boost libraries to link with (this option exists only to provide a way to enforce such a list: usually this should not be used). --with-boost-lib-dir Specify the path to Boost libraries to link with (usually there should be no reason to specify this option). --with-botan-config Specify the path to the botan-config script to build with Botan for the crypto code. --with-gtest Enable the building of the C++ Unit Tests using the Google Test framework. Optionally this can define the path to the gtest header files and library. (If the framework is not already installed on your system, it can be downloaded from .) --with-log4cplus Define the path to find the Log4cplus headers and libraries. --with-openssl Replace Botan by OpenSSL for the crypto library. The default is to try to find a working Botan then OpenSSL only if Botan is not found. --without-werror Disable the default use of the compiler flag so that compiler warnings do not result in build failures. For additional instructions concerning the building and installation of Kea for various databases, see . For additional instructions concerning the configuration backends, see . For example, the following command configures Kea to find the Boost headers in /usr/pkg/include, specifies that PostgreSQL support should be enabled, and sets the installation location to /opt/kea: $ ./configure \ --with-boost-include=/usr/pkg/include \ --with-dhcp-pgsql=/usr/local/bin/pg_config \ --prefix=/opt/kea If you have some problems with building Kea using the header-only Boost error code or you'd like to use the Boost system library (e.g., located in /usr/pkg/lib): $ ./configure \ --with-boost-libs=-lboost_system \ --with-boost-lib-dir=/usr/pkg/lib If the configure fails, it may be due to missing or old dependencies. ./configure when it succeeds displays a report with the building parameters. This report is saved into config.report and embedded into executable binaries, e.g., kea-dhcp4.
Build After the configure step is complete, build the executables from the C++ code and prepare the Python scripts by running the command: $ make
Install To install the Kea executables, support files, and documentation, issue the command: $ make install Do not use any form of parallel or job server options (such as GNU make's -j option) when performing this step: doing so may cause errors. The install step may require superuser privileges. If required, run ldconfig as root with /usr/local/lib (or with ${prefix}/lib if configured with --prefix) in /etc/ld.so.conf (or the relevant linker cache configuration file for your OS): $ ldconfig If you do not run ldconfig where it is required, you may see errors like the following: program: error while loading shared libraries: libkea-something.so.1: cannot open shared object file: No such file or directory
Selecting the Configuration Backend Kea 0.9 has introduced configuration backends that are switchable during the compilation phase. Only one backend, JSON, is currently supported. JSON JSON is the new default configuration backend that causes Kea to read JSON configuration files from disk. It does not require any framework and thus is considered more lightweight. It will allow dynamic on-line reconfiguration, but will lack remote capabilities (i.e. no RESTful API).
DHCP Database Installation and Configuration Kea stores its leases in a lease database. The software has been written in a way that makes it possible to choose which database product should be used to store the lease information. At present, Kea supports three database backends: MySQL, PostgreSQL and Memfile. To limit external dependencies, both MySQL and PostgreSQL support are disabled by default and only Memfile is available. Support for the optional external database backend must be explicitly included when Kea is built. This section covers the building of Kea with MySQL and/or PostgreSQL and the creation of the lease database.
Building with MySQL Support Install MySQL according to the instructions for your system. The client development libraries must be installed. Build and install Kea as described in , with the following modification. To enable the MySQL database code, at the "configure" step (see ), do: ./configure [other-options] --with-dhcp-mysql Or specify the location of the MySQL configuration program "mysql_config" if MySQL was not installed in the default location: ./configure [other-options] --with-dhcp-mysql=path-to-mysql_config See for details regarding MySQL database configuration.
Building with PostgreSQL support Install PostgreSQL according to the instructions for your system. The client development libraries must be installed. Client development libraries are often packaged as "libpq". Build and install Kea as described in , with the following modification. To enable the PostgreSQL database code, at the "configure" step (see ), do: ./configure [other-options] --with-dhcp-pgsql Or specify the location of the PostgreSQL configuration program "pg_config" if PostgreSQL was not installed in the default location: ./configure [other-options] --with-dhcp-pgsql=path-to-pg_config See for details regarding PostgreSQL database configuration.