Section 20.3. Objective 3: Operate and Perform Basic Configuration of Apache


20.3. Objective 3: Operate and Perform Basic Configuration of Apache

Apache is a phenomenal open source success story. Despite the availability of commercial web servers, Apache continues to be the most popular web server on the Internet. It is also widely deployed inside corporate networks for managing internal communications.

Because it is so popular and likely to be found on just about every Linux server, understanding the basics of Apache administration is required for Exam 102.

20.3.1. Configuring Apache

Apache is configured with the file httpd.conf located in /etc/httpd/conf, /etc/apache, or possibly another location, depending on your distribution or how Apache is installed.

Configuration is managed through configuration directives , one per line, in httpd.conf. The file can also contain comments, which begin with a #. Directives are in the form:

 DirectiveName [argument-list] 

For example, the DocumentRoot directive, which tells Apache where the top of the HTML tree is located, might look like this:

 DocumentRoot /home/httpd/html 

Here are some basic Apache configuration directives:


ServerType


Tip: This option was removed in Apache 2.0.

This directive can be either standalone or inetd. If you prefer to have inetd listen for inbound HTTP requests, set this to inetd and configure inetd.conf as needed. Running httpd from inetd has a major negative impact on performance, so it is almost never a good idea.


Port


Tip: This option was removed in Apache 2.0.

This parameter defines the port to which Apache listens. The default HTTP port is 80.


User and Group

These two parameters determine the name and group, respectively, that Apache executes under. Typical examples are nobody, www, and httpd.


ServerAdmin

This directive specifies the email address of the administrator, such as root@localhost.


DocumentRoot

This directive tells Apache where to find the top of the HTML tree, such as /home/httpd/html.


UserDir

System users may use a standard personal subdirectory for their own HTML documents. This directive determines the name of that directory. It is often set to public_html. Files for user jdean in the directory /home/jdean/public_html would be accessed using a URL of http://localhost/~jdean.

Of course, there are many more, and additional syntax is used when necessary. In httpd.conf, groups can be delineated by keywords that look like HTML. Directives in such a group affect only a subset of the content served by Apache. For example, the following group of directives controls CGI execution in /home/httpd/cgi-bin:

 <Directory /home/httpd/cgi-bin> AllowOverride None Options ExecCGI </Directory> 

On the Exam

The LPI exam Objectives don't specify particular Apache configuration directives, but you should be prepared to interpret various configuration examples and have knowledge of the three configuration files and their likely locations.


20.3.2. Starting and Stopping Apache

Typically, Apache is managed through the runlevel system and the series of scripts and links in /etc/init.d and /etc/rcn.d. See Chapter 5 for information on starting and stopping services such as Apache.



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net