20.3. Objective 3: Operate and Perform Basic Configuration of ApacheApache 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 ApacheApache 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:
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>
20.3.2. Starting and Stopping ApacheTypically, 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. |