image\howbutt.gifUsing the srm configuration file

The srm.conf file is the second file that must be configured to set up an HTTP server. The server's resource settings are defined in the srm.conf file. The server's resources are the data the client receives. For example, a graphic embedded in a Web page is an HTTP server's resource. You can configure or reconfigure the srm.conf file by setting the value of one or more directives. You can open the srm.conf file and change the value of a directive using a text editor. You can change the value of a directive at any time. Listed below are the important directives that appear in the srm.conf file.

DocumentRoot

The DocumentRoot directive specifies the directory where the HTML files and other files, such as graphic files, are located. See the following example:

DocumentRoot /var/www

Assume the domain name for the HTTP server is myNewHost.com. To access the file /var/www/index.html, you can enter the following URL into an Internet browser:

http://www.myNewHost.com

image\nicon.gif Note

UserDir

The UserDir directive lets each user on the network have a personal Web site. The Web site can be managed through the home directory. You must indicate the name of the user subdirectory in the home directory. You can disable this feature by setting this directive to disabled.

The convention normally used is public_html. Refer to the following:

UserDir /home/*/public_html

DirectoryIndex

The DirectoryIndex directive specifies which files should be the default files. For example, if you set this directive to index.html, then a request for http://myNewHost./docs/ would return http://myNewHost/docs/index.html. See the following example:

DirectoryIndex index.html

image\nicon.gif Note

AccessFileName

The AccessFileName directive specifies the file extension that contains access control information. Refer to the following:

AccessFileName .htaccess

If a file exists with a .htaccess file extension, then the file is checked for access control information.

image\nicon.gif Note

DefaultType

The DefaultType directive sets the default file type. If the HTTP server cannot determine a file type, then the default file type is used. You can set the default file type to text/html. See the following example:

DefaultType text/html

The server would treat the document as an HTML document. You should always specify the file type used in a Web site. For example, if you did not specify the file type of an image file, the file would not be treated as a image.

ScriptAlias

You can use the ScriptAlias directive to specify the directory where CGI programs are located. You can code CGI script in Perl or C programming languages. The HTTP server uses CGI script to perform specific actions. For example, the HTTP server can use CGI script to query a database for user records. This directive specifies which directory is used and the URL of that directory. Refer to the following:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

Assume the domain name for the HTTP server is myNewHost. The URL, http://myNewHost/cgi-bin, is set up so that the server will search the /usr/lib/cgi-bin directory for CGI scripts. The HTTP server will execute a file located in this directory, as opposed to returning it to the client.

image\nicon.gif Notes

XBitHack

You can use the XBitHack directive to allow the HTTP server to parse HTML documents. Parsing HTML documents means searching HTML documents for Server-Side Include (SSI) directives. For information about Server-Side includes, see "Working with Server Side Includes." If you want to use SSI directives, make sure you set the XBitHack directive to on. You can set this directive to one of the following:

In the following example, the XBitHack directive is set to on:

XBitHack on

image\nicon.gif Notes

AddHandler

The AddHandler directive lets you link a file with a specific file extension to a specific action. A file with a .cgi file extension is treated as a CGI program. However, be sure to place a .cgi file in the directory specified in the ScriptAlias directive. See the following example:

AddHandler cgi-script cgi

AddType

The AddType directive lets you create a new MIME type for a specific extension. MIME types inform the HTTP client how to manage a specific file. If the server passes a file with the text/plain MIME tag to the HTTP client, the HTTP client does not interpret the file as an HTML file. If a server passes a file with the text/html MIME tag, the HTTP client processes the file as an HTML file. See the following example:

AddType text/html

image\nicon.gif Note