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

Showing Directory Contents


If we have a download directory and want to easily serve an up-to-date listing of its contents, mod_dirlisting can do the job. It is configurable with the header and footer, custom CSS, and exclude filters (which should usually match our mod_access settings, to hide inaccessible files from the listing).

Note

mod_dirlisting versus Large Directories

Since Lighttpd is single-threaded, while the directory listing gets created, no other work is done by Lighttpd, as with all modules. Therefore, use mod_dirlisting only for small download directories—less than 100 entries should be a good rule of thumb. Otherwise, use a script through one of the CGI backends, which can run independently from Lighttpd.

Let us get straight to an example configuration of mod_dirlisting. In this example, we want to activate mod_dirlisting for the download directory, show a hidden HEADER.txt file (if there is one in the directory) before the listing, show "dotfiles" (starting with a ".") in the...