How to Install Hiawatha Web Server on Fedora Server Latest

In this tutorial, we will show you how to install Hiawatha on Fedora Server Latest. Hiawatha is a lightweight and efficient web server that offers great performance and security features.

Prerequisites

Before we proceed with the installation of Hiawatha on Fedora Server, you need to do the following:

Step 1: Update the System

Start by updating the system and all installed packages on Fedora Server.

sudo dnf update

Step 2: Install Required Dependencies

After the update is complete, we need to install some required dependencies to ensure that Hiawatha runs smoothly. Since Hiawatha is written in C, we will need GCC and make.

sudo dnf install gcc make

Step 3: Download Hiawatha Web Server

We will download the latest version of Hiawatha from the official website using the following command. Latest version

wget https://www.hiawatha-webserver.org/files/hiawatha-10.10.tar.gz

After the package is downloaded, extract it using the following command:

tar -xvzf hiawatha-10.12.tar.gz

Step 4: Install Hiawatha Web Server

After performing the extraction, we need to compile and install Hiawatha into the system.

cd hiawatha-10.12
sudo make && sudo make install

Step 5: Start Hiawatha Web Server

Now that Hiawatha is installed on your Fedora Server, you can start it using the following command.

sudo systemctl start hiawatha

Once it's running, you can verify its status using the following command:

sudo systemctl status hiawatha

We can see that our Hiawatha is now up and running on our Fedora Server.

Step 6: Configure Hiawatha Web Server

By default, Hiawatha listens on port 80. We can check it by accessing http://your_ip_address in a web browser.

We will now configure Hiawatha to secure our web server.

Before editing, remember to backup the original configuration file.

sudo cp /etc/hiawatha/hiawatharc /etc/hiawatha/hiawatharc.bak

Now that we have backed up the configuration file, let's configure it.

sudo nano /etc/hiawatha/hiawatharc

The Hiawatha configuration file is written in C-like syntax. To secure our web server, we need to modify a few lines.

Binding {
    Port = 80
}

# Replace `ServerId="hiawatha"` with your server name or domain name.
# Remember that `servername.com` must be a valid domain name.
Hostname = "servername.com"

WebsiteRoot = "/var/www/html"

# Add this line to enable HTTPS connections.
# HTTPS is required to ensure secure communication.
Binding {
    Port = 443
    Interface = 0.0.0.0
    Mode = https
    SSLcertFile = /etc/letsencrypt/live/servername.com/fullchain.pem
    SSLkeyFile = /etc/letsencrypt/live/servername.com/privkey.pem
    HSTSmaxAge = 31536000
}

# To deny access to the Hiawatha header.
HideServerHeader = yes

# To hide the PHP information banner.
CGIPassHeader = "X-Powered-By:"

# To deny access to specific file types.
DenyAll {
    File = "\.htpasswd$"
    File = "\.passwd$"
    File = "\.conf$"
}

# To deny access to specified IP addresses or ranges.
# IP addresses can be specified in both IPv4 and IPv6 format.
DenyAll {
    Host = "13.111.27.3"
    Host = "24.33.39.93"
}

After configuring the file, save it and restart the Hiawatha web server.

sudo systemctl restart hiawatha

Conclusion

In this tutorial, we have shown you how to install Hiawatha Web Server on Fedora Server Latest. In addition, we have demonstrated how to configure it to secure our web server. Now that you have Hiawatha Web Server installed on your server, you can explore how to host different types of websites with it.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!