DocumentRoot directive


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.


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.


If you do not specify a DocumentRoot, httpd assumes:

DocumentRoot /usr/local/etc/httpd/htdocs


DocumentRoot /home/web

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

Return to Resource Configuration File Overview

NCSA httpd Development Team