Difference between ServerRoot, DocumentRoot, and Directory
Asked Answered
A

5

24

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">
Agglomerate answered 10/5, 2011 at 9:25 Comment(0)
S
28
  • 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.
Saturated answered 10/5, 2011 at 9:29 Comment(0)
P
1

The default values for DocumentRoot and Directory for XAMPP is "C:\xampp\htdocs"

Paucker answered 10/5, 2011 at 9:30 Comment(0)
G
0

I would say that the most easiest way for you would be to check your xampp version, make a back up of your document root, which is probably "www" or "htdocs", your configuration files and eventually dump your database. Now install the same version of xammp again and there it is.

And at least the first rule is by playing with "config files", make backups before. The second rule is, make a backup of the whole configuration directory anyway, just for the case. And the last one is, if you are a xammp user, means you are a windows user, so you probably don't have unixoid server administration knowledges, so there is a long way for you to starting to "play" with the apache server.

The only think that you should know is, that you need to set the direction "AllowOverride All", which is necessary, if you use some content management system or other systems, which brings there own .htaccess file. So long you work on windows with xammp and not on a linux or other unixoid operating systems, you cannot understand the complete world of web servers like apache or database servers like postgresql and the sensibility of configuration files.

I understand the necessity of it for understanding of whole web applications respect. to be an full stack web programmer, but before that, i wouldn't change in the future the default server configurations, just check the row "AllowOverride All". Hope this will help your.

Goble answered 10/2, 2016 at 8:34 Comment(0)
E
0

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.

Epirus answered 18/7, 2017 at 5:9 Comment(0)
B
0

In apache configuration file,

*ServerRoot is for store server related files and configuration files. *DocumentRoot is where you store your web related files. *Directory is used to control the behavior of the server when handling requests for files from the specified directories.

(In most cases, Documentroot and Directory contain similar address at default)

Thank You!

Bussard answered 12/4 at 17:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.