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

Updated:   |  Apache (Web Server) articles

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
index.html

 

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




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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