364
Networking: A Beginner's Guide
The httpd.conf file is divided into three main sections:
Global environment
Main server configuration
Virtual hosts
Each of these sections contains a large number of directives that control how
Apache works.
When learning about Apache, you should spend some time studying the contents
of the httpd.conf file and reading the extensive comments included in the file. You
should also look up the various directives in the online Apache documentation
(http://httpd.apache.org/docs/), to get more information than provided by the
comments in the httpd.conf file.
Publishing Web Pages
By default (for Apache version 2), the main web site published by Apache is located in
the /var/www/html directory, and this directory is blank.
Once you are ready to publish a complete web site, you can place the files into /var/
www/html with the home page stored as index.html. The easiest way to do this is to
connect to the computer running Apache by using the FTP program, and then upload
the web site's files, either directly to the /var/www/html directory or to a temporary
directory on the server's hard disk. Once in the temporary directory, you can move them
to the correct location on the server itself using the mv or cp commands (these, among a
number of other useful Linux/UNIX commands, are covered in Chapter 21).
Chapter Summary
Most networking professionals will need to set up and maintain a web server in the
course of their work. All server platforms have web servers available for them. An
excellent web server that is available for just about all platforms is the Apache web
server. As you saw in this chapter, Apache is easy to install, administer, and get up and
running. If you have followed the instructions in the previous chapters and have set
up Fedora Linux on a test system, I recommend that you also follow the steps in this
chapter and set up and run Apache. Then add some files for a simple web site to it and
browse the web server first from the computer on which it's running, and then from
another computer on the network.
This chapter was intended to get you started with the Apache web server. If this is an
area in which you wish to gain greater expertise, you will find more details in resources
devoted to Apache server. Two books in this area that might interest you are Apache Server
2.0: A Beginner's Guide, by Kate Wrightson (McGraw-Hill/Professional, 2001) and Apache
Server 2.0: The Complete Reference, by Ryan Bloom (McGraw-Hill/Professional, 2002).