Chapter 11. Apache Configuration

Apache Configuration Tool requires the X Window System and root access. To start Apache Configuration Tool, use one of the following methods:

ImportantDo Not Edit httpd.conf
 

Do not edit the /etc/httpd/conf/httpd.conf Apache configuration file if you wish to use this tool. Apache Configuration Tool generates this file after you save your changes and exit the program. If you want to add additional modules or configuration options that are not available in Apache Configuration Tool, you cannot use this tool.

Apache Configuration Tool allows you to configure the /etc/httpd/conf/httpd.conf configuration file for your Apache Web server. It does not use the old srm.conf or access.conf configuration files; leave them empty. Through the graphical interface, you can configure Apache directives such as virtual hosts, logging attributes, and maximum number of connections.

Only modules that are shipped with Red Hat Linux can be configured with Apache Configuration Tool. If additional modules are installed, they can not be configured using this tool.

The general steps for configuring the Apache Web Server using the Apache Configuration Tool are as following:

  1. Configure the basic settings under the Main tab.

  2. Click on the Virtual Hosts tab and configure the default settings.

  3. Under the Virtual Hosts tab, configure the Default Virtual Host.

  4. If you want to serve more than one URL or virtual host, add the additional virtual hosts.

  5. Configure the server settings under the Server tab.

  6. Configure the connections settings under the Performance Tuning tab.

  7. Copy all necessary files to the DocumentRoot and cgi-bin directories, and save your settings in the Apache Configuration Tool.

Basic Settings

Use the Main tab to configure the basic server settings.

Figure 11-1. Basic Settings

Enter a fully qualified domain name that you have the right to use in the Server Name text area. This option corresponds to the ServerName directive in httpd.conf. The ServerName directive sets the hostname of the Web server. It is used when creating redirection URLs. If you do not define a Server Name, Apache attempts to resolve it from the IP address of the system. The Server Name does not have to be the domain name resolved from the IP address of the server. For example, you might want to set the Server Name to www.your_domain.com when your server's real DNS name is actually foo.your_domain.com.

Enter the email address of the person who maintains the Web server in the Webmaster email address text area. This option corresponds to the ServerAdmin directive in httpd.conf. If you configure the server's error pages to contain an email address, this email address will be used so that users can report a problem by sending email to the server's administrator. The default value is root@localhost.

Use the Available Addresses area to define the ports on which Apache will accept incoming requests. This option corresponds to the Listen directive in httpd.conf. By default, Red Hat configures Apache to listen to ports 80 and 8080 for non-secure Web communications. Click the Add button to define additional ports on which to accept requests. A window as shown in Figure 11-2 will appear. Either choose the Listen to all addresses option to listen to all IP addresses on the defined port or specify a particular IP address over which the server will accept connections in the Address field. Only specify one IP address per port number. If you want to specify more than one IP address with the same port number, create an entry for each IP address. If at all possible, use an IP address instead of a domain name to prevent a DNS lookup failure. Refer to http://httpd.apache.org/docs/dns-caveats.html for more information about Issues Regarding DNS and Apache. Entering an asterisk (*) in the Address field is the same as choosing Listen to all addresses. Clicking the Edit button shows the same window as the Add button except with the fields populated for the selected entry. To delete an entry, select it and click the Delete button.

Figure 11-2. Available Addresses

TipTip
 

If you set Apache to listen to a port under 1024, you must be root to start it. For port 1024 and above, httpd can be started as a regular user.