next up previous contents
Next: The Server Configuration Up: NCSA's HTTPD Server Previous: Configuration of HTTPD

Setting the Server Resource Map - srm.conf

DocumentRoot /www/htdocs

This is the directory that forms the root of the directory tree as seen in URLs. For instance, with DocumentRoot set to `` /www/htdocs'', the URL http://www.host.name/subdir/index.html would correspond to the file `` /www/htdocs/subdir/index.html''.

UserDir public_html

HTTPD allows URLs of the form
http://www.host.name/~ a_user/mydir/index.html.
If `` /usr/home/a_user'' is the home directory of the user with username `` a_user''gif, then specifying `` UserDir'' to be `` public_html'' means that this URL would be expanded to
/usr/home/a_user/public_html/mydir/index.html
Of course this directory has to be readable by the user id that the www server is being run with.

DirectoryIndex index.html

When a client requests a URL without specifying a filename within a directory, this is the name of the file HTTPD looks for to return. For instance, with DirectoryIndex set to `` index.html'', the URL `` http://www.host.name/mydir/'' would fetch the file
`` mydir/index.html''

AccessFileName .htaccess

HTTPD allows two ways of specifying access control mechanisms on a per directory basis. One is to have an entry per directory in the access.conf file in the configuration directory. The second is to put an access file in each directory you want to protect. The value specified for AccessFileName says what these per directory access files will be called if they exist.

AddType image/jpeg jpeg jpg

AddType lets you add MIME types in addition to the standard ones, or to specify new file extensions for existing MIME gif types. For example, if we have software that generates filenames with both `` .jpg'' and `` .jpeg'' extensions, the above entry would specify that both extensions denote a JPEG image file.

Redirect /list.html http://www.cs.ucl.ac.uk/misc/uk/intro.html

Redirect allows you to tell clients where a document has moved to. For instance if you used to maintain a list of servers, but no longer have the time to do so, you may redirect people who use your page to someone else's list. Redirection is usually transparent to the user.

Alias /local/pubs.html /misc/uk/london/pubs.html

Specifying Alias values allow you to move files around on your server without breaking any links anyone else may have to them. For instance, if we have a directory called local that was getting cluttered, you could specify the alias above and move the actual file to misc/uk/london/pubs.html . You should avoid overuse of this facility.

ScriptAlias /cgi-bin /www/cgi-bin

Specifying ScriptAlias values allows you to say which directories contain commands to be executed rather than files to be retrieved. You may specify several different ScriptAlias entries if you wish. Specifying the script alias of /cgi-bin to be `` /www/cgi-bin'' as above says that URLs of the form
http://www.host.name/cgi-bin/date
should be dealt with by running the date program that is located in the /www/cgi-bin directory. See section 5.5.1 for details about passing arguments to CGI programs.

srm.conf also can contain a number of other commands such as those which let you configure automatic indexing of directories.



next up previous contents
Next: The Server Configuration Up: NCSA's HTTPD Server Previous: Configuration of HTTPD



Jon Crowcroft
Wed May 10 11:46:29 BST 1995