是什么让域名指向特定文件夹?
我正在开发一台从某人那里继承的服务器,而且我不是 DNS 问题方面的专家。 该服务器托管多个域,并且它们都位于名为 /vhosts/ 的文件夹下。 我似乎无法理解域如何指向它们各自的文件夹。我检查了httpd.config,没有这样的指令:
<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
我还检查了域管理员,它们都指向服务器IP。那么我错过了什么?
i'm working on a server that i inherited from someone, and i'm not a big expert on dns issues.
the server hosts more than one domains, and they are all under a folder called /vhosts/.
i can't seem to understand how domains are pointing to their respective folder there. i checked httpd.config and there is no directive like this:
<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
i also checked the domain admin and they are all pointing to the server ip. so what am i missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DocumentRoot
是指示特定托管域的文件夹名称的指令。对于服务器上托管的每个域,httpd.conf
文件中都会有一个
节点。例如,example1.com 和 example2.com 托管在该服务器上,它们的请求分别由 /vhosts/www/example1 和 /vhosts/www/example2 提供服务。有时这些设置是在其他配置文件中定义的。其他配置文件在启动期间包含在 httpd.conf 中。如果您无法找到包含该文件的文件,那么我建议您运行
grep -ri "VirtualHost" /
。DocumentRoot
is the directive which tells the folder name for a specific hosted domain. For each domain which is hosted on the server, there will be one<VirtualHost>
node in thehttpd.conf
file. So for example, example1.com and example2.com are hosted on this server and their requests are served from /vhosts/www/example1 and /vhosts/www/example2 respectively.Sometimes these settings are defined in other config files. Other config files are included in httpd.conf during startup. If you are unable to find the file that has it then I would suggest that you run
grep -ri "VirtualHost" /
.系统可以配置为大规模虚拟主机:
或者,可以在通过 Include 语句引入的包含文件中声明虚拟主机的配置。检查 httpd.config 中是否包含对其他虚拟主机的语句...
如果其他方法都失败,请转到配置目录的根目录并运行以下命令:
应该给您提示在哪里查找...
The system could be configured for mass virtual hosting:
Alternately, the configurations for the virtual hosts could be declared in included files brought in through an Include statement. Check the
httpd.config
for Include statements to other vhosts ...if all else fails, go to the root of the configuration directory and run the following:
Should give you a hint where to look ...