In this tutorial we’ll learn how to install Lighttpd Web Server on CentOS 7. We will also install and configure its prerequisites. Lighttpd is an open source web server which is secure, fast, compliant, and very flexible and is optimized for high-performance environments. It uses very low memory compared to other web servers, small CPU load and speed optimization making it popular among the server for its efficiency and speed. Its advanced, feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) makes lighttpd the perfect webserver-software for every server that suffers load problems.
I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.
Install Lighttpd Web Server on CentOS 7
Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:
yum -y install epel-release yum -y update
Step 2. Installing Lighttpd Web Server.
Install Lighttpd using yum package manager:
yum install lighttpd
Once the packages are installed, you can run the Lighttpd server also enable it to automatically start at boot time using the following commands:
systemctl start lighttpd systemctl enable lighttpd
Step 3. Configuring Lighttpd.
If we need to configure our lighttpd web server further as our requirements, we can make changes to the default configuration file ie /etc/lighttpd/lighttpd.conf.
Lighttpd’s default document root is /srv/www/lighttpd , you can use this or change it by editing the configuration file /etc/lighttpd/lighttpd.conf.
Step 4. Configure Firewall for Lighttpd.
Issue the following commands to allow HTTP request through the firewall:
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --reload
Step 5. Testing Lighttpd.
To make sure everything installed correctly we will now test Lighttpd to ensure it is working properly. Open up any web browser and then enter the following into the web address:
http://localhost/ or http://your.ip.addr.ess
Congratulation’s! You have successfully install Lighttpd on your CentOS 7 server. Thanks for using this tutorial for installing Lighttpd Web Server on CentOS 7 system.