How to install Hiawatha Web Server in Debian

To install Hiawatha Web Server on Debian

Hiawatha is an open source, light-weight, secure and easy to use Web Server. Its small size makes it perfect for deploying an embedded devices or less powerful machines. In this tutorial you' ll be briefed about the installation of Hiawatha Web Server on your Debian machine.

Installation Hiawatha Webserver

The initial step is to add the key, use the following command for the same.

root@linuxhelp:~# apt-key adv --recv-keys --keyserver keys.gnupg.net 79AF54A9
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.Ut0OZiqEsP --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg --recv-keys --keyserver keys.gnupg.net 79AF54A9
gpg: requesting key 79AF54A9 from hkp server keys.gnupg.net
gpg: key 79AF54A9: public key " Chris Wadge (tuxhelp.org package signing key) < cwadge@tuxhelp.org> "  imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

Now, add repo link on apt source list as follows.

root@linuxhelp:~# nano /etc/apt/sources.list
deb http://mirror.tuxhelp.org/debian/ squeeze main

Once repo is added, update the apt source.

root@linuxhelp:~# apt-get update
Ign http://dl.google.com stable InRelease
Hit http://dl.google.com stable Release.gpg                                    
Hit http://dl.google.com stable Release                                        
Hit http://ftp.debian.org jessie-updates InRelease                             
Hit http://dl.google.com stable/main amd64 Packages                            
Ign http://ftp.debian.org stable InRelease                                     
Get:1 http://mirror.tuxhelp.org squeeze InRelease [5,249 B]                    
Hit http://ftp.debian.org jessie-updates/main Sources                          
Hit http://security.debian.org jessie/updates InRelease                        
Get:2 http://mirror.tuxhelp.org squeeze/main amd64 Packages [2,909 B]          
Hit http://ftp.debian.org jessie-updates/contrib Sources                       
Get:3 http://ftp.debian.org jessie-updates/main amd64 Packages/DiffIndex [6,424 B]
Hit http://security.debian.org jessie/updates/main Sources                     
Hit http://ftp.debian.org jessie-updates/contrib amd64 Packages                
Hit http://ftp.debian.org jessie-updates/contrib Translation-en                
.
.
.
http://ftp.debian.org stable/non-free amd64 Packages                       
Hit http://security.debian.org jessie/updates/contrib Translation-en           
Hit http://ftp.debian.org stable/contrib Translation-en                        
Hit http://ftp.debian.org stable/main Translation-en                           
Hit http://security.debian.org jessie/updates/main Translation-en              
Hit http://ftp.debian.org stable/non-free Translation-en                       
Ign http://mirror.tuxhelp.org squeeze/main Translation-en_US       
Ign http://mirror.tuxhelp.org squeeze/main Translation-en
Fetched 17.3 kB in 3s (4,570 B/s)
Reading package lists... Done

Next install Hiawatha Webserver. Use the following command for the same.

root@linuxhelp:~# apt-get install hiawatha
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  php-fpm
The following NEW packages will be installed:
  hiawatha
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 474 kB of archives.
After this operation, 1,085 kB of additional disk space will be used.
Get:1 http://mirror.tuxhelp.org/debian/ squeeze/main hiawatha amd64 10.4 [474 kB]
Fetched 474 kB in 6s (75.2 kB/s)                                               
Selecting previously unselected package hiawatha.
(Reading database ... 141951 files and directories currently installed.)
Preparing to unpack .../hiawatha_10.4_amd64.deb ...
Unpacking hiawatha (10.4) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u5) ...
Setting up hiawatha (10.4) ...
Processing triggers for systemd (215-17+deb8u5) ...

Now Hiawatha is ready to be accessed. Open the browser and type your localhost IP as follows.
http://192.168.5.130

The browser displays about the successful installation of Hiawatha.

FAQ
Q
Instead of a directory index, I get "No input file specified." What goes wrong?
A
There are two solutions to this issue:
1.Set the StartFile for that directory to a non-CGI file, by adding "StartFile = index.html" to a .hiawatha file in that directory.
2. Tell Hiawatha to look at the result of the FastCGI daemon and show the directory index if that result is a '404 Not Found' by using "TriggerOnCGIstatus = yes" in virtual host section in the Hiawatha configuration.
Q
Does Hiawatha support GZip content encoding?
A
Yes. Hiawatha automatically generates and serves GZip-encoded versions of static text-based files such as HTML, XML, CSS, and JavaScript, according to the requesting browser's accepted encodings. Compressed versions of files are served from a cache, avoiding repeated CPU-intensive encoding on each request.
Q
All the hostnames within a domain should show the same website. Is that possible?
A
Yes, you can do this by using a wildcard. Before using the wildcard, a complete hostname must be specified. It is necessary for 301 (redirect) errors.
VirtualHost {
Hostname = www.website.net, *.website.net
...
}
Q
Can Hiawatha show the content of a directory?
A
Yes, use the following option for the VirtualHost section or in a .hiawatha configuration file inside that directory:
ShowIndex = yes
Q
Can I specify multiple start files for a virtual host?
A
No. If you want to use a different start file for a directory, use the StartFile option in a .hiawatha file in that directory.