
Chapter 3. Getting started
reason the parent decides whether or not to replace it. (If they have all been idle for
the past 48 hours it may decide that four processes are plenty.) If they are all kept too
busy the parent may choose to start up some more processes to share the load. The
set of child processes is called the server pool and is the traditional mechanism that
Apache has always used to provide rapid responses. This way of working is called
the pre-forked model.
There are other models other than pre-forked, but Red Hat Linux has this enabled by
default and it is what we will use throughout the course.
Figure 3-10. No documents!
At the moment, the server has nothing to serve. Every attempt to request a
page from it results in a 404, not found error. If we look in the error log file,
/var/log/httpd/error_log we will see the error message:
[Tue Mar 18 13:42:10 2003] [error] File does not exist: /etc/httpd/htdocs
which indicates that the server is looking in the wrong place!.
We need to tell it where to look. However, as we are planning on hosting two web
sites we ought to be thinking about two locations, one for each value of the Host:
header. We should also think about what to do with requests that have neither
chalk.dept.cam.ac.uk nor cheese.dept.cam.ac.uk as the Host: header’s value.
Use valid DNS names
The names used for the virtual hosts cannot just be made up. They
must be registered in the DNS for the IP address of the server being
used. Typically there will be a “real” name for the server (given by the
DNS A record) and a number of aliases for the web sites (given by DNS
CNAME records).
We shall create two subdirectories, CHALK and CHEESE, of /var/www for the two web-
sites. We will also create two groups, chalk and cheese, which will contain the people
18
Commentaires sur ces manuels