设置指向另一个IP的子域
我正在使用 Apache,并且尝试为虚拟主机设置一个子域,然后该子域指向不同 IP 地址上的服务器。
所以虚拟主机是www.example.com,我想设置images.example.com,并将其指向127.0.0.1。
我已经在 SO 和其他网站上咨询了一些已回答的问题,但我有点不知所措,我不想冒险破坏生产站点。非常感谢任何帮助。
I'm using Apache, and I'm trying to set up a subdomain for a virtual host, which then points to a server on a different IP address.
So the virtual host is www.example.com, I'd like to set up images.example.com, and point it to 127.0.0.1.
I've consulted some of the answered questions on SO and other sites, but I'm a bit overwhelmed and I don't want to risk wrecking a production site. Any help greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,如果您可以控制该域的 DNS 条目,那将是最好、最简单的解决方案 - 只需让 www.example.com 指向 IP 地址 xxx.xxx.xxx.xxx 和 images.example.com 指向 xxx .xxx.xxx.yyy。假设您拥有可用于这两个域的不同的可公开访问的 IP 地址。它假设您可以控制您的 DNS 条目。
如果情况并非如此,那么您可能对我在另一个 Apache 问题上发布的答案感兴趣:https://stackoverflow.com/ a/8319842/1072282
它涉及让一台 apache 服务器应答同一 IP 地址上的多个域,然后将其中一个域的请求发送(代理)到另一台服务器在那里服务。
Well, if you have control over your DNS entries for this domain, that would be the best and simplest solution- just have www.example.com point to IP address xxx.xxx.xxx.xxx and images.example.com point to xxx.xxx.xxx.yyy. That assumes you have different publicly accessible IP addresses that you can use for the two domains. And it assumes that you have control over your DNS entries.
If that is not the case, then you may be interested in an answer I posted on another Apache question: https://stackoverflow.com/a/8319842/1072282
It deals with having one apache server answer for multiple domains on the same IP address, but then sends (proxies) requests for one of the domains to another server to be served there.