Skip to Content
Apache: The Definitive Guide, 3rd Edition
book

Apache: The Definitive Guide, 3rd Edition

by Ben Laurie, Peter Laurie
December 2002
Intermediate to advanced
588 pages
25h 57m
English
O'Reilly Media, Inc.
Content preview from Apache: The Definitive Guide, 3rd Edition

Making Better Indexes in Apache

There is a wide range of possibilities; some are demonstrated at ... /site.fancyindex /httpd1.conf:

User webuser
Group webgroup
ServerName www.butterthlies.com
DocumentRoot /usr/www/APACHE3/site.fancyindex/htdocs

<Directory /usr/www/APACHE3/site.fancyindex/htdocs>
IndexOptions FancyIndexing
AddDescription "One of our wonderful catalogs" catalog_summer.html /
    catalog_autumn.html
IndexIgnore *.jpg
IndexIgnore  ..
IndexIgnore  icons HEADER README
AddIconByType (CAT,icons/bomb.gif) text/*
DefaultIcon icons/burst.gif
</Directory>

When you type ./go 1 on the server and access http://www.butterthlies.com/ on the browser, you should see a rather fancy display:

Index of /
  Name                        Last Modified     Size Description 
--------------------------------------------------------------------
    <bomb>catalog_autumn.html 23-Jul-1998 09:11 1k   One of our wonderful catalogs 
    <bomb>catalog_summer.html 25-Jul-1998 10:31 1k   One of our wonderful catalogs 
    <burst>index.html.ok      23-Jul-1998 09:11 1k 
--------------------------------------------------------------------

In the previous listing, <bomb> and <burst> stand in for standard graphic icons Apache has at its disposal. How does all this work? As you can see from the httpd.conf file, this smart formatting is displayed directory by directory. The key directive is IndexOptions.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tomcat: The Definitive Guide, 2nd Edition

Tomcat: The Definitive Guide, 2nd Edition

Jason Brittain, Ian F. Darwin
HTTP: The Definitive Guide

HTTP: The Definitive Guide

David Gourley, Brian Totty, Marjorie Sayer, Anshu Aggarwal, Sailu Reddy
Nginx HTTP Server - Fourth Edition

Nginx HTTP Server - Fourth Edition

Martin Bjerretoft Fjordvald, Nedelcu

Publisher Resources

ISBN: 0596002033Supplemental ContentErrata Page