Apache's DocumentRoot directive

posted: Friday 22 January 2010 by Tavis J. Hampton in: Web Hosting VPS & Dedicated Web servers

Apache directives

Apache HTTP Server gives you the flexibility to decide where you want to store the web-accessible files for your websites. Most operating systems have their own unique directory structure for their default web server installations, but even those can be changed. The Apache default document root is /usr/local/apache/htdocs.

To change the document root, use the following directive in your httpd.conf or virtual host configuration file:

DocumentRoot directory-path

Replace “directory-path” with the path you want to use. For example:

DocumentRoot /var/www/public_html

Make sure you do not have a trailing slash. With this setup, a file, such as index.html, found in /var/www/public_html/index.html will appear on the web at: http://www.yourdomain.com/index.html. Whatever directory you choose must be readable (but not writable) by outside users.

Source: Apache.org

1 stelle2 stelle3 stelle4 stelle5 stelle (no votes)
share this 0 comments

Be the first to add a comment to this article.

Your email address is required but won't be displayed.
Leave a comment

Register to reserve your nickname accross all the blogs in the Blogo network and to upload your avatar. If you already are registered, login to user your nickname.

Yes No

Comment preview

Network Blogo