
Chapter 3. Getting started
ServerName
This sets the name of the server for the virtual host. If a query’s Host: header
does not match this then the virtual host block will not be applied.
DocumentRoot
This command specifies where the server should look for its documents for the
particular virtual host. This is where we get to split up our various hosts into
different directories.
We do not need to restart our web server after each change to the configuration file.
A rather faster mechanism is to cause it to reread its file to note changes. This is done
by using the reload option on the startup script.
# /etc/init.d/httpd reload
Reloading httpd: [ OK ]
Figure 3-14. Getting the server to reread its configuration file
We are now running one web server supporting two web sites. However, if we re-
quest the index.html page from chalk.dept.cam.ac.uk then we get the source of the
homepage and not the HTML rendering of it. We still have work to do.
Figure 3-15. Contacting the chalk.dept.cam.ac.uk web site; index.html
For completeness we should cover the assorted options that can be passed to the
startup script beyond the start, restart and reload options we have met already..
Options to the startup script /etc/init.d/httpd
start
Starts the web server.
20
Comentarios a estos manuales