通过 Apache 将子域指向另一个 IP
仅使用 Apache 是否可以将子域指向特定的 IP 地址?
我们目前有一个主域 (www.example.com) 和 250 多个子域(site1.example.com、site2.example.com 等)。由于有关 SSL 证书的规则,我们现在必须将 www.example.com 放在它自己的 IP 地址上(尽管它仍然驻留在同一服务器上)。
子域当前配置为别名记录,因此为每个子域创建 250 多个新 A 记录将是一个很大的麻烦。
我希望有一个基于 Apache 的解决方案来解决这个问题,这样我就不必花费剩下的时间来配置 DNS 记录。
Is it possible, using only Apache, to point a subdomain at a specific IP address?
We currently have a primary domain(www.example.com) with 250+ subdomains(site1.example.com, site2.example.com, etc). Due to rules regarding an SSL cert, we now have to place www.example.com on it's own IP address(although it still resides on the same server).
The subdomains are currently configured as alias records, so creating 250+ new A records for each subdomain would be a major hassle.
I would love an Apache-based solution to this problem so that I don't have to spend the rest of my day configuring DNS records.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使 mod_proxy 将所有请求从一台虚拟主机传递到另一台服务器,这听起来正是您正在寻找的。
您还可以使用 mod_rewrite 和 [P] 选项来执行此操作,这可以给你更多的灵活性。
You can make mod_proxy pass all requests from one virtual host to another server, which sounds like exactly what you're looking for.
You could also do this with mod_rewrite and the [P] option, which can give you a lot more flexibility.