阿帕奇虚拟主机
我正在尝试设置我的 VPS 来托管两个域。 httpd.conf 的虚拟主机部分如下:
<VirtualHost www.siteA.com>
DocumentRoot /home/XXXXX/public_html/siteA
ServerName www.siteA.com
<Directory "/home/XXXXX/public_html/siteA">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost www.siteb.com>
DocumentRoot /home/XXXXX/public_html/siteb/
<Directory "/home/XXXXX/public_html/siteb/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
但是,当我在浏览器中输入域时,两者都会解析到同一站点(httpd.conf 文件中第一个站点)。上面的内容有明显的错误吗?
除此之外,当我注册这两个域名时,我还注册了两组名称服务器(ns1/ns2.siteA.com & ns1/ns2.siteB.com),并且两者的IP地址相同,如下所示我目前只有一个 IP 地址。这也可能是一个问题吗?我不认为是这样,但它可能值得一提。
其他信息:在 Centos 4 上运行的 Apache 2.2.3。使用命令行编辑(大部分)和 Webmin 1.5 的混合来控制 VPS。
有什么想法吗? 谢谢!
I'm trying to set up my VPS to host two domains. The virtual host section of the httpd.conf is as follows:
<VirtualHost www.siteA.com>
DocumentRoot /home/XXXXX/public_html/siteA
ServerName www.siteA.com
<Directory "/home/XXXXX/public_html/siteA">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost www.siteb.com>
DocumentRoot /home/XXXXX/public_html/siteb/
<Directory "/home/XXXXX/public_html/siteb/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
However when I enter the domains into a browser, both resolve to the same site ( to the site that is first in the httpd.conf file). Is there anything obviously wrong with the above?
Aside from this, when I registered the two domain names, I also registered two sets of nameservers (ns1/ns2.siteA.com & ns1/ns2.siteB.com) and the IP address of both of these are the same, as I currently only have a single IP address. Could this also be a problem? I don't think it is, but its probably worth mentioning.
Other info: Apache 2.2.3 running on Centos 4. Using a mixture of command line editing (mostly) and Webmin 1.5 to control the VPS.
Any thoughts?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加
到食谱中。来自参考:
Add
to the recipe. From the reference: