Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between ServerRoot, DocumentRoot, and Directory

Tags:

While playing with Apache, I messed up the paths without making a backup httpd.config file.

The file is located at C:\xampp\apache\conf\httpd.config

I want to keep my web project on the D: drive as a virtual folder. This is the current non-working state. How can I fix this or revert to the xampp defaults?

ServerRoot "C:\xampp\apache" DocumentRoot "D:\workspace" <Directory "D:\workspace\AutionWebSite"> 
like image 239
Gainster Avatar asked May 10 '11 09:05

Gainster


People also ask

What DocumentRoot directory is used for?

The document root is a directory (a folder) that is stored on your host's servers and that is designated for holding web pages. When someone else looks at your web site, this is the location they will be accessing.

Where is the DocumentRoot directory?

The DocumentRoot is the top-level directory in the document tree visible from the web and this directive sets the directory in the configuration from which Apache2 or HTTPD looks for and serves web files from the requested URL to the document root.

What is the DocumentRoot?

The web server document root is the root directory of the web server running on your system. The documents under this root are accessible to any system connected to the web server (provided the user has permissions). If a file is not under this root directory, then it cannot be accessed through the web server.

What is the difference between the server root and the document root?

Server Root "/Local" -specifies the default directory hierarchy for the Apache installation. Document Root"/Local/WWW/apache22/data" - the directory out of which you will serve your documents.


1 Answers

  • ServerRoot = path to the webserver executable/dir
  • DocumentRoot = path to your files that are delivered by the server
  • The <Directory> directive is used to configure settings for a specific directory. However, the <Directory> command in your question is not complete.
like image 101
abaumg Avatar answered Sep 30 '22 10:09

abaumg