如何在一台服务器上运行具有多个IP地址的多个网站?
目前,我有两个网站在单个 Amazon EC2 上运行并使用 Apache Web 服务器。配置 Apache 使用虚拟主机并使用单个 IP 地址非常简单。但我认为 Amazon 最多为您提供 5 个 IP 地址,并且希望将两个 IP 地址附加到单个 EC2 实例,并为每个站点使用这些 IP 地址。
如何配置网站 A 使用 IP 地址之一接收和发送数据的服务器?
Currently I have two websites running on single Amazon EC2 and using Apache web server. Configuring Apache to use virtual host and use a single IP address was simple . But I think Amazon gives you up to 5 IP addresses and would like attach two IP addresses to a single EC2 instance and use those IP addresses for each site.
How do I configure the server that Website A uses one of the IP address for incoming and outgoing data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,每个实例只能映射 1 个弹性 IP。这是一个令人讨厌的限制,因为我想使用默认端口 443 的 SSL 设置多个站点,但我不能。如果需要的话,我通常只使用其他端口,但这不是最佳实践。
与一个实例关联的弹性 IP 是免费的。您可以在管理控制台或通过 API 进行设置。您的服务器应该有自己的内部 IP 地址,弹性 IP 会转换为该地址。
您可以使用 AWS 负载平衡执行一些操作,它允许您对一个实例使用多个 ssl 站点。
Unfortunately, you can only map 1 elastic IP per instance. Its a nasty limitation, because I would love to setup multiple sites using SSL with default port of 443 but I cannot. I usually just use other ports if I have to, but that is not best practice.
The associated elastic IP to the one instance is free. You can set that up in the management console or through the API. Your server should come with its own internal IP address, and the elastic IP gets translated to that.
There are things that you can do with AWS load balancing, which allow you to use multiple ssl sites to one instance.
如果您在 VPC 中运行实例,您现在可以执行此操作。
您可以创建多个 ENI(弹性网络接口)并将任意数量的 ENI 与单个实例关联。
此功能的公告位于 http://aws.typepad.com/aws/2012/07/multiple-ip-addresses-for-ec2-instances-in-a-virtual-private-cloud.html
You can now do this if you run your instance in a VPC.
You can create multiple ENIs (Elastic Network Interfaces) and associate any number of them with a single instance.
The announcement for this feature is at http://aws.typepad.com/aws/2012/07/multiple-ip-addresses-for-ec2-instances-in-a-virtual-private-cloud.html