2.1. What Is a Web Site?

It might be a good idea to get a firm idea of what, in the Apache business, a web site is: It is a directory somewhere on the server, say, /usr/www/site.for_instance. It contains at least three essential subdirectories:

conf

Contains the Config file, which tells Apache how to respond to different kinds of requests

htdocs

Contains the documents, images, data, and so forth that you want to serve up to your clients

logs

Contains the log files that record what happened

Most of this book is about writing the Config file, using Apache's 150 or so directives. Nothing happens until you start Apache. If the conf subdirectory is not in the default location (it usually isn't), you need a flag that tells Apache where it is.

   

httpd -d /usr/www/site.for_instance
         

   

apache -d c:/usr/www/site.for_instance
         

Notice that the executable names are different under Win32 and Unix. The Apache Group decided to make this change, despite the difficulties it causes for documentation, because "httpd" is not a particularly sensible name for a specific web server, and, indeed, is used by other web servers. However, it was felt that the name change would cause too many backward compatibility issues on Unix, and so the new name is implemented only on Win32.

Also note that ...

Get Apache: The Definitive Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.