If you are looking for a great alternative to Apache or Nginx then lighttpd is your best bet. But first, what is lightpd?
Security, speed, compliance, and flexibility — all of these describe lighttpd (pron. lighty) which is rapidly redefining the efficiency of a webserver; as it is designed and optimized for high-performance environments. With a small memory footprint compared to other web servers, effective management of the CPU-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting, and many more) lighttpd is the perfect solution for every server that is suffering load problems. And best of all it’s Open Source licensed under the revised BSD license.
For this guide we will need the following:
- A webserver running Ubuntu 20.04. We will be using a dedicated server from Spin Servers.
Step 1 — Upgrade your system
First things first, always update your system before installing any software or making changes. To do this, using this command:
$ sudo apt-get upgrade
Step 2 — Install lighttpd
Now that we have performed our updates, we can install lighttpd on our system.
$ sudo apt install lighttpd
You will be prompted to answer a Y/N question to install lighttpd, select
Y and continue the install.
Step 3 — Start lighttpd and check the status
Since lighttpd is a system service we will need to use
systemctl to manage the operation. To do input this command:
$ sudo systemctl enable lighttpd
This command will enable lighttpd on your system. To check the status of lighttpd and ensure its working, we will use:
$ sudo systemctl status lighttpd
This should list a green
active output. If it does then your web server is running and operational. But, let's check the status page via our web browser.
From this point, using a web browser you should be able to navigate to where you installed the webserver.
You should be greeted with the placeholder page.
If you are viewing this page, then congratulations. You are now running a Ubuntu 20.04 system with lighttpd web server.
Now what? Well… install a database like MySQL/Maria or MongoDB and PHP8!