Example Output

To illustrate mod_reveal.c in use, we used the following configuration:

Listen 9001
Listen 9000

TransferLog /home/ben/www/APACHE3/book/logs/access_log
ErrorLog /home/ben/www/APACHE3/book/logs/error_log
RevealTag MainDir
RevealServerTag MainServer
<LocationMatch /.reveal>
RevealTag Revealer
SetHandler reveal

<VirtualHost *:9001>
DocumentRoot /home/ben/www/APACHE3/docs
RevealTag H1Main
RevealServerTag H1
<Directory /home/ben/www/APACHE3/docs/protected>
 RevealTag H1ProtectedDirectory
<Location /protected>
 RevealTag H1ProtectedLocation

<VirtualHost *:9000>
DocumentRoot /home/camilla/www/APACHE3/docs
RevealTag H2Main
RevealServerTag H2

Note that the <Directory> and <Location> sections in the first virtual host actually refer to the same place. This is to illustrate the order in which the sections are combined. Also note that the <LocationMatch> section doesn’t have to correspond to a real file; looking at any location that ends with .reveal will invoke mod_reveal.c ’s handler. Starting the server produces this on the screen:

bash$ httpd -d ~/www/APACHE3/book/ CreateServer: server=(none):0 CreateDir : dir=(none) PreConfig [2.0] Tag : new=MainDir dir=(none) server=(none):0 tag=(none) ServerTag : new=MainServer server=(none):0 stag=(none) CreateDir : dir=/.reveal Tag : new=Revealer dir=/.reveal server=(none):0 tag=MainServer CreateDir : dir=(none) CreateServer: server=(none):9001 Tag : new=H1Main dir=(none) ...

Get Apache: The Definitive Guide, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.