Lighttpd is a high-performance web server suitable for running in production environments. It is a highly optimized, secure and very flexible web server; LightTPD uses very low memory and CPU compared to other web servers. Its event-driven architecture is optimized for large numbers of parallel connections (keep-alive)
Lighttpd powers some popular Web 2.0 sites. It provides high-speed IO infrastructure that enables them to scale many times on the same hardware. This was developed with future networks in mind, such as faster FastCGI, COMET compliant mod_mailbox, and asynchronous IO.
You can follow the steps below to install Lighttpd on a RHEL-based system.
Step 1: Add EPEL repository
EPEL yum repository has the latest Lighttpd package, first add EPEL yum repository in your system.
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Step 2: Install LightTPD server
Use yum package manager to install lighttpd
# yum install lighttpd lighttpd-fastcgi
Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: mirror.nbrc.ac.in * epel: mirrors.ispros.com.bd * extras: mirror.nbrc.ac.in * updates: mirror.nhanhoa.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package lighttpd.i686 0:1.4.35-1.el6 will be installed ---> Package lighttpd-fastcgi.i686 0:1.4.35-1.el6 will be installed --> Processing Dependency: spawn-fcgi for package: lighttpd-fastcgi-1.4.35-1.el6.i686 --> Running transaction check ---> Package spawn-fcgi.i686 0:1.6.3-1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================== Package Arch Version Repository Size =================================================================================================== Installing: lighttpd i686 1.4.35-1.el6 epel 300 k lighttpd-fastcgi i686 1.4.35-1.el6 epel 45 k Installing for dependencies: spawn-fcgi i686 1.6.3-1.el6 epel 16 k Transaction Summary =================================================================================================== Install 3 Package(s) Total download size: 361 k Installed size: 818 k Is this ok [y/N]: y Downloading Packages: (1/3): lighttpd-1.4.35-1.el6.i686.rpm | 300 kB 00:00 (2/3): lighttpd-fastcgi-1.4.35-1.el6.i686.rpm | 45 kB 00:00 (3/3): spawn-fcgi-1.6.3-1.el6.i686.rpm | 16 kB 00:00 --------------------------------------------------------------------------------------------------- Total 206 kB/s | 361 kB 00:01 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. ** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows: google-chrome-stable-34.0.1847.116-1.i386 has missing requires of libnss3.so(NSS_3.14.3) Installing : lighttpd-1.4.35-1.el6.i686 1/3 Installing : spawn-fcgi-1.6.3-1.el6.i686 2/3 Installing : lighttpd-fastcgi-1.4.35-1.el6.i686 3/3 Installed: lighttpd.i686 0:1.4.35-1.el6 lighttpd-fastcgi.i686 0:1.4.35-1.el6 Dependency Installed: spawn-fcgi.i686 0:1.6.3-1.el6 Complete!
Step 3: Configure LightTPD server
Before starting the lighttpd configuration, make sure selinux is disabled in the system.
# getenforece
Now edit the Lighttpd configuration file /etc/lighttpd/lighttpd.conf
server.use-ipv6 = "disable" server.max-fds = 2048
server.use-ipv6: Setting this value to "diable" will allow the server to listen for IPv6 connections and disable IPv6 connect.
server.max-fds Lighttpd is a single-threaded server whose main resource limit is the number of file descriptors, which is set to 1024 by default (on most systems). To handle high traffic sites, you can set this to 2048.
Step 4: Start the LightTPD server
Finally use the following command to start the lighttpd service
# service lighttpd start
To stop or restart the server, use the following command.
# service lighttpd stop # service lighttpd restart
Make lighttpd start when the server starts
# chkconfig lighttpd on
[Related recommendations: Linux video tutorial]
The above is the detailed content of How to install Lighttpd web server on CentOS and RHEL using Yum. For more information, please follow other related articles on the PHP Chinese website!