Book Image

Lighttpd

By : Andre Bogus
Book Image

Lighttpd

By: Andre Bogus

Overview of this book

Table of Contents (20 chapters)
Lighttpd
Credits
About the Author
About the Reviewer
Preface
HTTP Status Codes

Chapter 2. Configuring and Running Lighttpd

In this chapter, we will learn:

  • How to configure Lighttpd

  • What Selectors are

  • How to use Selectors

  • How to rewrite and redirect requests

  • How to include variables in the configuration files

Now that you have successfully installed Lighttpd onto your system, I will show you how to configure it to serve web pages (yes, just web pages, nothing else) and expand from there. Lighttpd needs a configuration file called lighttpd.conf—in fact it will not run without one. To make it as simple as possible, we start with the absolute minimum:

server.document-root = "/var/www"
mimetype.assign = ("" => "text/html")

Yes, that is all. Of course you should take the path to your website as your document root. Under UNIX, /var/www is a probable path, while Windows users may want to put their site in a place like C:\www\mysite. The mimetype.assign statement simply says that everything is to be served as if it were an HTML page.

Put this lighttpd.conf into the standard directory...