image\howbutt.gifUsing the httpd configuration file

The httpd.conf file contains settings known as directives. You can configure or reconfigure the httpd.conf file by setting the value of one or more directives. You can open the httpd.conf file and change the value of a directive using a text editor. You can change the value of a directive at any time. For example, you can specify the maximum number of HTTP clients that can connect to the HTTP server by setting the MaxClients directive. When this directive is set at 200, only 200 HTTP clients can connect to the HTTP server at once. For example, you can change this directive and set the value to 250. Reconfiguring the httpd.conf file allows the HTTP server to be dynamic and respond to Internet traffic. Listed below are the important directives that appear in the httpd.conf file.

ServerType

You can set the Apache server to run in standalone or inetd mode. An HTTP server that is set to standalone has its own processes and continuously waits for HTTP client connections. If the HTTP server is set to inetd, then the HTTP server waits for connections and starts Apache when a connection is made.

The following example sets the ServerType to standalone:

ServerType standalone

image\nicon.gif Note

ServerAdmin

You can specify the email address of the Web site administrator. When a problem occurs, such as a server not being able to display a specific Web page, the user can contact the administrator. If you do not provide a valid email address, problems might not be reported. The following example specifies an administrator's email address.

ServerAdmin Frankj@myDomin.com

Port

You should set the port used for the HTTP server to 80. The standard TCP port used for the HTTP protocol is 80. If you change this value, the HTTP server may conflict with another server. If a Web browser requests an URL without a port, the HTTP client assumes port 80 is used. The following example sets the port directive to 80:

Port 80

image\nicon.gif Note

ServerRoot

The ServerRoot directive lets you specify the directory where the srm.conf and access.conf files are located. See the following example:

ServerRoot /etc/apache

ServerName

The ServerName directive lets you specify a domain name for the server. You must provide a valid domain name for the Apache server. In the case of the sample httpd.conf file, the setting for the ServerName directive is myHost_doc1. You can use the DNS protocol to produce a valid domain name. See the following example:

ServerName myHost_doc1

In this case, myHost_doc1 is the name of the computer where the server is located.

User and group

The user and group directives are related to security. By default, the HTTP server runs as root which is considered undesirable. As a root user, the HTTP client has access to system files. Changing certain system files might damage the system. You should set the user and group directives to a valid user and group. This ensures the HTTP server runs as the user and not as root. It is recommended that you set up a new user and group specifically for running the HTTP server. Some Web administrators use the value nobody for the User and Group directive. See the following example:

User nobody

Group nobody

In this case, a user named nobody is set up on the computer where the HTTP server is located. For information about setting up a new user, see the Corel LINUX User Guide.

image\nicon.gif Note

Timeout directive

The timeout directive defines the amount of time the HTTP server waits for three process to occur. The first is the time it takes to receive a GET request. The second is the amount of time between receipt of TCP packets on a POST or PUT request. The third is the amount of time between ACKs on transmissions of TCP packets in responses. The time is defined in seconds. See the following example:

Timeout 300

ErrorLog directive

You must specify the location of the error log. The HTTP server uses the error log to store errors that occur on the system. See the following example:

ErrorLog /var/log/apache/error.log

MaxClients directive

You can specify the maximum number of clients who can connect to the HTTP server at once. In the following example, 150 clients can connect. See the following example:

MaxClients 150