The rewrite.conf
file described in the
previous FAQ also includes a couple of Alias directives.
These are processed by Apache's mod_alias module (which is
compiled in by default).
mod_alias is sort of like a simple version of mod_rewrite,
except that (as far as I can figure) it performs a function
that mod_rewrite won't do. At the end of the last section,
the rule mapping URLs to the PHP script get.php3
doesn't get invoked on internal sub-requests (that is, when
Apache calls itself with a URL). In PHP, these requests
are generated by a call to the apache_lookup_uri
function, which returns what Apache thinks the headers it should
send back to the client for this file are.
When a group admin turns on CVS authoring for the group, the
webmaster list is sent mail requesting that the web/
subdirectory of that group's CVS module be checked out into the Web
server's file-space. For the group diva, for example, that
directory will be checked out into directory
/home/www/cvswww/diva
.
Now, when get.php3
processes a file that it recognizes
is under /home/www/cvswww
, it needs to find out what kind
of file it is: if it is HTML, it needs to process the HTML and generate
the GSRC headers and margins; if it is a GIF (say), it needs to return
the correct headers to the browser and then send the (unprocessed)
file back. The way it finds out what the MIME type is (and other
info) is by generating an internal sub-request to Apache with
apache_lookup_uri
. But in order for Apache to know where
to find the file, it requires this Alias directive:
Alias /cvswww/ "/home/stagewww/cvswww/"
There are a couple of other Alias directives. For example, this one tells Apache where the PHP scripts are:
Alias /php/ "/home/stagewww/php/"(Actually, this one should probably be turned off once all PHP scripts are reachable through the other rewrite rules.)