DocumentRoot directive


Purpose

The DocumentRoot directive sets the directory from which httpd will serve files.

If you need to serve files outside this directory, you can use the Alias directive, or create symbolic links.

This directive affects how you access files on your server.


Syntax

DocumentRoot dir

Where dir is an absolute path of the directory you want documents to be served from.

Only one DocumentRoot directive is allowed in the server configuration file.


Default

If you do not specify a DocumentRoot, httpd assumes:

DocumentRoot /usr/local/etc/httpd/htdocs


Example

DocumentRoot /home/web

This would set DocumentRoot to the directory /home/web.


Return to Resource Configuration File Overview

httpd@ncsa.uiuc.edu