FreeKB - Apache (Web Server) DocumentRoot directive
Apache (Web Server) - DocumentRoot directive

Document root is the directory that contains the files that the web server will send to the client, such as HTML and JPG files. Typically, the web servers conf file (e.g. httpd.conf) contains the document root directive. In this example, the document root is /var/www/html.

The document root directive must not end with a trailing forward slash.

DocumentRoot "/var/www/html"


In this example, the document root directory contains a single HTML file, index.html.

~]# ls /var/www/html


Since the document root directory contains index.html, when the client navigates to, the content of the index.html file should be displayed in the clients browser.

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 39391 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |