开发者

Difference between ServerRoot, DocumentRoot, and Directory

开发者 https://www.devze.com 2023-03-04 16:07 出处:网络
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

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:\wor开发者_C百科kspace"
<Directory "D:\workspace\AutionWebSite">


  • 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.


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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消