How To Install darkhttpd on CentOS 7

In this tutorial we learn how to install darkhttpd on CentOS 7. darkhttpd is A secure, lightweight, fast, single-threaded HTTP/1.1 server

Introduction

In this tutorial we learn how to install darkhttpd on CentOS 7.

What is darkhttpd

darkhttpd is a secure, lightweight, fast and single-threaded HTTP/1.1 server. == Features == * Simple to set up * Single binary, no other files. * Standalone, doesn’t need inetd or ucspi-tcp. * No messing around with config files. * Written in C - efficient and portable. * Small memory footprint. * Event loop, single threaded - no fork() or pthreads. * Generates directory listings. * Supports HTTP GET and HEAD requests. * Supports Range / partial content. * Supports If-Modified-Since. * Supports Keep-Alive connections. * Can serve 301 redirects based on Host header. * Uses sendfile(). == Security == * Can log accesses, including Referer and User-Agent. * Can chroot. * Can drop privileges. * Impervious to /../ sniffing. * Times out idle connections. * Drops overly long requests. == Limitations == * This server only serves static content - NO CGI supported!

We can use yum or dnf to install darkhttpd on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install darkhttpd.

Install darkhttpd on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install darkhttpd using yum by running the following command:

sudo yum -y install darkhttpd

Install darkhttpd on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install darkhttpd using dnf by running the following command:

sudo dnf -y install darkhttpd

How To Uninstall darkhttpd on CentOS 7

To uninstall only the darkhttpd package we can use the following command:

sudo dnf remove darkhttpd

References

Summary

In this tutorial we learn how to install darkhttpd on CentOS 7 using yum and dnf.