For Techs.... Techniques.... Technologies....


How to install lighttpd in Linux server

lighttpd is a secure, fast, compliant, and very flexible web-server that has been optimized for high-performance environments. It has a very low memory footprint compared to other webservers and takes care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) make lighttpd the perfect webserver-software for every server that suffers load problems.

This tutorial exlains the detailed steps to install lighttpd in Linux server.

Step1: Login to the server via ssh

Step2: Change the location

#cd /user/local/src/

Step3: Download the lighttpd source package


Step4: Extract the downloaded source file

#tar -zxvf lighttpd-1.4.34.tar.gz

Step5: Change the location to the extracted folder

#cd lighttpd-1.4.34

Step6: Compile and install lighttpd using the following commands.

#./configure --host=i686-redhat-linux-gnu \
--build=i686-redhat-linux-gnu \
--target=i386-redhat-linux \
--program-prefix= --prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-openssl \
--with-pcre \
--with-zlib \
--with-bzip2 \
--disable-ipv6 \
--with-PACKAGE=mod_redirect \
--with-rewrite \

#make && make install

Step7: Create the document root for lighttpd

#mkdir /var/www/html/htdocs

Step8: Create the configuration folder for lighttpd

#mkdir /etc/lighttpd/

Step9: Create the new group with name lighttpd

#groupadd lighttpd

Step10: Create a new user 'lighttpd' with group 'lighttpd'

#adduser -g lighttpd -d /var/www/html -s /sbin/nologin lighttpd

Step11: Create log folder for lighttpd

#mkdir /var/log/lighttpd

Step12: Create log files for lighttpd

#touch /var/log/lighttpd/access.log
#touch /var/log/lighttpd/error.log

Step13: Correct the ownership of lighttpd logfolder recursively

#chown -R lighttpd:lighttpd /var/log/lighttpd

Step14: Copy lighttpd configuration files.

#cp -rvf /user/local/src/lighttpd-1.4.34/doc/config/* /etc/lighttpd/

Step15: Correct the ownership of lighttpd configuration files

#chown -R lighttpd:root /etc/lighttpd

Step16: Modify the lighttpd configuration file with the following lines.

var.server_root = "/var/www/html"

server.bind = ""

Step17: Copy the lighttpd init script

#cp -rvf /user/local/src/lighttpd-1.4.34/doc/initscripts/rc.lighttpd.redhat /etc/init.d/lighttpd

Step19: Correct the permissions for lighttpd init script

#chmod 755 /etc/init.d/lighttpd

Step20: Start lighttpd service

#/etc/inid.d/lighttpd start

That's all...

Leave a Reply