29.1. Introduction to Apache

Apache is the Internet's most popular HTTP server, due to its zero cost, wide availability, and large feature set. All Linux distributions include it as a standard package, and it can be installed on or compiled for every other UNIX variant supported by Webmin. It has a very large number of option directives defined in a text configuration file, however, and so can be hard for an inexperienced administrator to set up.

Over the years since it was first introduced, many versions of Apache have been released. Starting with 1.0 and moving through to the current 1.3 and 2.0 series, each version has included more features and options. The basic web server functionality and configuration file layout has remained the same throughout, even though the internal implementation has changed significantly.

Apache has a modular design, in which each module is responsible for some part of its overall feature set. There are several standard modules that are included with almost every install of Apache, and many more that are optional or have to be downloaded separately. Modules can be compiled into the web server executable, or dynamically loaded from shared libraries at runtime. This modular architecture can be used to save memory by avoiding the need to load modules that do not provide any useful functionality for a particular system.

Apache takes its configuration from multiple text files, each of which contains a series of directives, usually one per line. Each directive has a name and one or more values and sets an option such as the path to a log file or the MIME type for some file. The directives that Apache recognizes are dependant on the modules in use. Most modules add support for several directives to configure the functions that they provide.

Often, you will want to host more that one website on a single server. Apache can be configured to use a different configuration depending on the website that is requested by a browser. Each one of these sites is called a virtual host and is defined in the configuration file with a special <Virtualhost> section. All directives inside this virtual host section apply only to requests that match their IP address or hostname.

Similarly, <Directory> and <Files> sections can be defined in the configuration file to contain directives that apply to only a certain directory or to files matching a particular pattern. These are often used to deny access to certain files on your system, to password protect them, or to control the way that they are displayed to clients.

Another method of creating directives that apply to only a single directory is to put them in a special configuration file named.htaccess that resides in the directory itself. Often these files will be created by regular users so they can configure their websites without needing full access to the master configuration file. This is very useful on a system that hosts multiple sites that are each owned by a different UNIX user, rather than on a system with only one website that is set up by the server's owner.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.40.63