CentOS – Installing Lighttpd

CentOS – Installing Lighttpd


This article explains how to install the Lighttpd Web Server on a CentOS 5.8 64-Bit Server.

Installing Lighttpd

Lighttpd is available as an rpm package from rpmforge.net which is an additional repository that needs to be added to the CentOS server first.

To install the rpmforge repository perform the following steps :-

  • Change in the /tmp folder and at the command prompt execute the following to download the 64 Bit package :-

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

  • To install the package execute the following command :-

rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

  • Next to install Lighttpd execute the following command :-

yum install lighttpd.x86_64

Configuring Lighttpd To Work With SELinux

If you have SELinux running and enforced on the server perform the following steps to allow Lighttpd to start :-

  • At the command prompt execute the following :-

semodule -DB

  • Next restart the Auditd service by executing the following  :-

service auditd restart

  • To create a new SELinux Policy to allow Lighttpd to start execute the following :-

grep lighttp /var/log/audit/audit.log | audit2allow -M lighttpdmaxfds

  • Finally to enable the new SELinux Policy execute the following commands :-

semodule -i lighttpdmaxfds.pp

semodule -B

Configuring To Start Automatically

Once the Lighttpd package has been installed the next step is to configure it to start automatically on boot.  To configure Lighttpd to start automatically perform the following step :-

  • In the command line execute the following command :-

chkconfig –levels 236 lighttpd on

  • Finally to start Lighttpd execute the following command :-

service lighttpd start