Lighttpd

From ArchWiki

Jump to: navigation, search

Contents

Introduction

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.
Source: The lighttpd website.

Step 1: Installation

Lighttpd is available in the extra repository so:

# pacman -S lighttpd

Step 2: Configuration

Basic Setup

The lighttpd configuration file is: /etc/lighttpd/lighttpd.conf. By default it should produce a working test page.

The default configuration file specifies /srv/http/ as the document directory served.

It may be necessary to add a user and group for http if you don't already have one. That user seems to need to have permissions to write to the /var/log/lighttpd as well, so we'll make it the owner of that folder.

# groupadd http
# adduser http
# chown -R http /var/log/lighttpd

To test the install

# /etc/rc.d/lighttpd start
# touch /srv/http/index.html
# chmod 755 /srv/http/index.html
# echo 'TestMe!' >> /srv/http/index.html

Then point your browser to localhost, and you should see the test page.

You may want to add lighttpd to the daemons list in /etc/rc.conf to start the server on boot.

FastCGI, PHP, Ruby on Rails, etc

For additional setup and configuration of additional lighttpd components, please see the following articles:

Personal tools