HOWTO: Compilation and Installation

Introduction

The first section below features instructions on how to compile and install Hiawatha from source code for most Linux, BSD, and UNIX operating systems. However, it is strongly recommended that you install pre-compiled binaries using your particular operating system's package installation tools. The second section includes instructions on how to compile and install Hiawatha from source code for Debian and Debian-based Linux distributions.

The location of various Hiawatha files depends upon installation method and operating system. When installing Hiawatha with a Linux package, the binaries are usually located in /usr/sbin and the configuration files in /etc/hiawatha. When installing it with a BSD port or by compiling from source, the binaries are usually located in /usr/local/sbin and the configuration files in /usr/local/etc/hiawatha.

To verify the location of the Hiawatha binaries, .conf files, and man pages after installation, as the root user, execute the following commands:

updatedb
whereis hiawatha cgi-wrapper newroot php-fcgi wigwam

Compile and install from source code

In order to compile and install source code, you first need a complete C compiler toolchain installed on your system. Consult the relevant documentation for your operating system to find out how to install this software.

Additionally, the following libraries need to be installed on your system in order to use Hiawatha's full functionality: libxml2 and libxslt

Hiawatha requires CMake to compile. Download the latest release and install it before compiling Hiawatha.

Download the Hiawatha source tarball from the download page. Unpack the source tarball and enter the hiawatha-<version> source directory with the following commands:

tar -xzf hiawatha-<version>.tar.gz
cd hiawatha-<version>

To configure Hiawatha source code for compiling, execute the following commands:

cd hiawatha-<version>
mkdir build
cd build
cmake ..

The following options for CMake are available. Default value is in uppercase.

-DENABLE_CACHE=ON|offEnable cache support in Hiawatha.
-DENABLE_DEBUG=on|OFFEnable debug information (for development only).
-DENABLE_IPV6=ON|offEnable IPv6 support in Hiawatha.
-DENABLE_MONITOR=on|OFFEnable support for the Hiawatha Monitor.
-DENABLE_RPROXY=ON|offEnable reverse proxy support in Hiawatha.
-DENABLE_TLS=ON|offEnable TLS (mbed TLS) support in Hiawatha.
-DENABLE_TOMAHAWK=on|OFFEnable Tomahawk in Hiawatha.
-DENABLE_TOOLKIT=ON|offEnable the URL toolkit in Hiawatha.
-DENABLE_XSLT=ON|offEnable XSLT support in Hiawatha.

The following path settings are available for CMake.

-DCMAKE_INSTALL_PREFIX=<path>The prefix for all other CMAKE_INSTALL directories.
-DCMAKE_INSTALL_BINDIR=<path>Location of the ssi-cgi binary.
-DCMAKE_INSTALL_SBINDIR=<path>Location of the other Hiawatha binaries.
-DCMAKE_INSTALL_SYSCONFDIR=<path>The configuration files will be installed in /hiawatha.
-DCMAKE_INSTALL_LIBDIR=<path>The mbed TLS shared library will be installed in /hiawatha.
-DCMAKE_INSTALL_MANDIR=<path>Manual pages will be installed in /man1.
-DCONFIG_DIR=<path>Location of the Hiawatha configuration files.
-DLOG_DIR=<path>Log directory used in the default hiawatha.conf.
-DPID_DIR=<path>Location of the Hiawatha and php-fcgi PID files.
-DWEBROOT_DIR=<path>Webroot directory used in the default hiawatha.conf.
-DWORK_DIR=<path>Path of directory where Hiawatha can write temporary files.

To compile Hiawatha, execute the following command:

make

As the root user, install Hiawatha with the following command:

make install/strip

Verify

If upgrading from a previous version of Hiawatha, execute the following command to verify that the current hiawatha.conf file is compatible with the newly installed binary:

hiawatha -k

The following output is produced when the newly installed binary is compatible with the hiawatha.conf:

Using <location of hiawatha.conf>
Reading hiawatha.conf
Configuration OK

If verification is unsuccessful, please review Hiawatha documentation and use the search function of the Hiawatha website. If you still can not find the answer, please post to the forums.

Compile Debian Package

To create a Debian package, execute the following script from the source directory and follow the instructions on the screen:

./extra/make_debian_package

To install the package, execute the following command as root:

dpkg -i hiawatha_<version>_<architecture>.deb

If upgrading from a previous version of Hiawatha, execute the following command to verify that the current hiawatha.conf file is compatible with the newly installed binary:

hiawatha -k

The following output is produced when the newly installed binary is compatible with the hiawatha.conf:

Using <location of hiawatha.conf>
Reading hiawatha.conf
Configuration OK

If verification is unsuccessful, please review Hiawatha documentation and use the search function of the Hiawatha website. If you still can not find the answer, please post to the forums.

To remove a .deb package installed with dpkg, as the root user execute the following command:

dpkg --purge hiawatha

Note that this command will remove all Hiawatha binaries, as well as all configuration files and man pages.