The httpd.conf file (to be found in ... /site.first) contains the following:
User webuser Group webgroup ServerName my586 DocumentRoot /usr/www/APACHE3/APACHE3/site.first/htdocs TransferLog logs/access_log #Listen is needed for Apache2 Listen 80
In the first edition of this book, we mentioned the directives
AccessConfig
and ResourceConfig
here. If set with /dev/null
(NUL under Win32), they disable the
srm.conf and access.conf
files, and they were formerly required if those files were absent.
However, new versions of Apache ignore these files if they are not
present, so the directives are no longer required. However, if they
are present, the files mentioned will be included in the Config file.
In Apache Version 1.3.14 and later, they can be given a directory
rather than a filename, and all files in that directory and its
subdirectories will be parsed as configuration files.
In Apache v2 the directives AccessConfig
and
ResourceConfig
are abolished and will cause an
error. However, you can write: Include
conf/srm.conf
Include
conf/access.conf
in that order, and at the end of the Config file.
Apache v2 also, rather oddly, insists on a
Listen
directive. If you
don’t include it in your Config file, you will get
the error message:
...no listening sockets available, shutting down.
If you are using Win32, note that the User
and
Group
directives are not supported, so these can
be removed.
Apache’s role in life is delivering documents, and so far we have not done much of that. We therefore begin in a modest way with a little HTML document that lists our cards, gives their prices, and tells interested parties how to get them.
We can look at the Netscape Help item “Creating Net Sites” and download “A Beginners Guide to HTML” as well as the next web person can, then rough out a little brochure in no time flat:[1]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html> <head> <title> Butterthlies Catalog</title> </head> <body> <h1> Welcome to Butterthlies Inc</h1> <h2>Summer Catalog</h2> <p> All our cards are available in packs of 20 at $2 a pack. There is a 10% discount if you order more than 100. </p> <hr> <p> Style 2315 <p align=center> <img src="bench.jpg" alt="Picture of a bench"> <p align=center> Be BOLD on the bench <hr> <p> Style 2316 <p align=center> <img src="hen.jpg" ALT="Picture of a hencoop like a pagoda"> <p align=center> Get SCRAMBLED in the henhouse <HR> <p> Style 2317 <p align=center> <img src="tree.jpg" alt="Very nice picture of tree"> <p align=center> Get HIGH in the treehouse <hr> <p> Style 2318 <p align=center> <img src="bath.jpg" alt="Rather puzzling picture of a bathtub"> <p align=center> Get DIRTY in the bath <hr> <p align=right> Postcards designed by Harriet@alart.demon.co.uk <hr> <br> Butterthlies Inc, Hopeful City, Nevada 99999 </body> </HTML>
We want this brochure to appear in ...
/site.first/htdocs, but we will in fact be using it in
many other sites as we progress, so let’s keep it in
a central location. We will set up links to it using the
Unixln
command, which
creates new directory entries having the same modes as the original
file without wasting disk space. Moreover, if you change the
“real” copy of the file, all the
linked copies change too. We have a directory
/usr/www/APACHE3/main_docs, and this document
lives in it as catalog_summer.html. This file
refers to some rather pretty pictures that are held in four
.jpg files. They live in ...
/main_docs and are linked to the working
htdocs directories:
% ln /usr/www/APACHE3/main_docs/catalog_summer.html . % ln /usr/www/APACHE3/main_docs/bench.jpg .
The remainder of the links follow the same format (assuming we are in .../site.first/htdocs).
If you type ls,
you should see the files there as
large as life.
Under Win32 there is unfortunately no equivalent to a link, so you will just have to have multiple copies.
[1] See also HTML & XHTML: The Definitive Guide, by Chuck Musciano and Bill Kennedy (O’Reilly & Associates, 2002).