ServerRoot、DocumentRoot和目录之间的区别。

时间:2023-01-20 16:03:46

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

在和Apache一起玩的时候,我打乱了路径,没有做一个备份httpd。配置文件。

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

该文件位于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?

我想把我的web项目放在D:驱动器作为一个虚拟文件夹。这是当前的非工作状态。如何修复或还原到xampp默认值?

ServerRoot "C:\xampp\apache"
DocumentRoot "D:\workspace"
<Directory "D:\workspace\AutionWebSite">

4 个解决方案

#1


18  

  • ServerRoot = path to the webserver executable/dir
  • 服务器根=路径到webserver可执行/目录。
  • 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.
  • 指令用于为特定目录配置设置。但是,在您的问题中 命令不完整。

#2


1  

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

XAMPP的DocumentRoot和目录的默认值是“C:\ XAMPP \htdocs”

#3


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.

我想说,最简单的方法是检查xampp版本,将文档根备份,这可能是“www”或“htdocs”,您的配置文件,最终转储您的数据库。现在重新安装xammp的同一版本,就在这里。

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.

至少第一个规则是通过使用“配置文件”来进行备份。第二个规则是,无论如何,对整个配置目录进行备份,只是为了这个例子。最后一个是,如果你是xammp用户,意味着你是一个windows用户,所以你可能没有unixoid服务器管理知识,所以你有很长的路要开始与apache服务器“玩”。

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.

您应该知道的唯一的想法是,您需要设置“AllowOverride All”的方向,这是必要的,如果您使用一些内容管理系统或其他系统,这将带来自己的.htaccess文件。只要在windows上使用xammp,而不是在linux或其他unix操作系统上,您就无法理解像apache或数据库服务器这样的web服务器的完整世界,比如postgresql和配置文件的敏感性。

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.

我理解它对于理解整个web应用程序的重要性。要成为一个完整的堆栈web程序员,但在此之前,我不会在将来更改默认的服务器配置,只需检查“AllowOverride All”行。希望这对你有帮助。

#4


0  

Server Root "/Local" -specifies the default directory hierarchy for the Apache installation.

服务器根“/本地”-指定Apache安装的默认目录层次结构。

Document Root"/Local/WWW/apache22/data" - the directory out of which you will serve your documents.

文档根“/Local/WWW/apache22/data”——您将为文档服务的目录。

#1


18  

  • ServerRoot = path to the webserver executable/dir
  • 服务器根=路径到webserver可执行/目录。
  • 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.
  • 指令用于为特定目录配置设置。但是,在您的问题中 命令不完整。

#2


1  

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

XAMPP的DocumentRoot和目录的默认值是“C:\ XAMPP \htdocs”

#3


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.

我想说,最简单的方法是检查xampp版本,将文档根备份,这可能是“www”或“htdocs”,您的配置文件,最终转储您的数据库。现在重新安装xammp的同一版本,就在这里。

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.

至少第一个规则是通过使用“配置文件”来进行备份。第二个规则是,无论如何,对整个配置目录进行备份,只是为了这个例子。最后一个是,如果你是xammp用户,意味着你是一个windows用户,所以你可能没有unixoid服务器管理知识,所以你有很长的路要开始与apache服务器“玩”。

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.

您应该知道的唯一的想法是,您需要设置“AllowOverride All”的方向,这是必要的,如果您使用一些内容管理系统或其他系统,这将带来自己的.htaccess文件。只要在windows上使用xammp,而不是在linux或其他unix操作系统上,您就无法理解像apache或数据库服务器这样的web服务器的完整世界,比如postgresql和配置文件的敏感性。

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.

我理解它对于理解整个web应用程序的重要性。要成为一个完整的堆栈web程序员,但在此之前,我不会在将来更改默认的服务器配置,只需检查“AllowOverride All”行。希望这对你有帮助。

#4


0  

Server Root "/Local" -specifies the default directory hierarchy for the Apache installation.

服务器根“/本地”-指定Apache安装的默认目录层次结构。

Document Root"/Local/WWW/apache22/data" - the directory out of which you will serve your documents.

文档根“/Local/WWW/apache22/data”——您将为文档服务的目录。