将 LAMP 服务从共享托管移植到 AWS EC2 时的 DNS 解决方案
我在共享托管提供商上创建了基于 LAMP 的服务。它现在已经发展壮大,我想将其转移到 AWS EC2 上。我已经移植了代码和数据,为持久内容设置了 ESB,设置了一个可以正常启动的 AMI 映像,并在 EC2 上测试了该解决方案。
我现在想将我的 DNS 重定向到 EC2 实例 IP。我已询问我的共享托管提供商是否可以将 TLD 记录 (domain.com) 重定向到此 IP,但他们说他们只能安全地重定向子域(如 www.domain.com),因为如果 TLD 重定向,cPanel 就会中断。我不确定我是否遵循问题详细信息,但看起来我必须租用 DNS 解决方案。
我还有哪些选择?我认为 DynDNS.com 是一种解决方案(或类似的服务),还有什么?或者,在商业 DNS 服务中,在可靠性、服务质量、支持质量等方面有哪些好的选择?
I have create a LAMP based service on a shared hosting provider. It has now grown and I want to move it on AWS EC2. I have already ported the code and the data, set up ESB for the persistent content, set up an AMI image that boots up fine and has tested the solution on EC2.
I want now to redirect my DNS to the EC2 instance(s) IP. I have asked my shared hosting provider if they can redirect the TLD record (domain.com) to this IP, but they say they can only redirect safely a subdomain (like www.domain.com) because the cPanel breaks if the TLD is redirected. I'm not sure I follow the problem details, but it looks like I have to rent a DNS solution.
What alternatives do I have? I think DynDNS.com is one solution (or a similar service), what else? Or, amongst commercial DNS services, what are good choices in terms of reliability, quality of service, quality of support etc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看来你一只脚踩在船上,一只脚踩在岸上!但好消息是您即将成功!
我建议离开您的共享主机。如果他们无法支持您的此类请求,则表明您的服务已经无法满足您的需求。有几个选项供您考虑。
首先,将网络托管从共享迁移到 AWS 时,您还需要考虑如何处理 DNS、电子邮件和 cPanel 服务。我使用 AWS 进行网络托管,但使用单独的 DNS 和电子邮件提供商。我不使用 cPanel - 我只是手动配置 DNS 和 Web 服务器。这使得事情变得更加简单和灵活,唯一的额外成本是单独配置 DNS 的一些时间。 cPanel、Plesk 和类似的系统给 Apache 添加了很多不必要的复杂性,我发现这会导致以后出现问题。
不过,如果您想保留 cPanel,您可以考虑在 AWS 上安装它或其他一些基于 Web 的管理系统。 (我敢打赌,如果您环顾四周,您会找到为此目的预先构建的 AMI。)
我不确定是否在 AWS 上运行 DNS 服务器,但我认为使用 DNS 服务会更容易、更可靠。
EasyDNS.com 和 No-IP.com 都是出色的 DNS 主机 - 我使用 No-IP 进行企业 AWS 网络托管已有 2 年多了。 (它特别好,因为它们提供监控以及自动和手动 DNS 故障转移,以防出现问题。但是,这可能超出您的需要。)我使用 EasyDNS 有 4 或 5 年了。这两项服务都有坚实的支持并且非常可靠。
如果您想要免费的东西,MyDomain.com 对我来说近 10 年来一直非常可靠,但支持速度非常慢。即使您没有向 MyDomain 注册域名,MyDomain 也会免费托管您的 DNS。
除此之外,最后一个考虑因素是:亚马逊还提供弹性 IP,它基本上是您的 Web 服务器实例的静态 IP。使用此功能将使您的 DNS 变得更加简单,如果您需要的话,您可以灵活地在将来轻松更改为新实例。我强烈建议使用弹性 IP。
Seems on you have one foot on the ship and on one the shore! But the good news is you're almost there!
I suggest leaving your shared host. If they are unable to support you with such a request, it's a good sign you've outgrown the service. There are a few options for you to consider.
First of all, when moving web hosting from shared to AWS, you also need to consider what to do with the DNS, email and cPanel services. I use AWS for web hosting, but separate providers for DNS and email. I don't use cPanel - I just configure DNS and the web server manually. This keeps things much simpler and much more flexible, and the only extra cost is a bit of time to configure DNS separately. cPanel, Plesk and similar systems add a lot of unnecessary complexity into Apache and I find this causes problems later.
Though, if you want to keep cPanel, you might consider installing it or some other web-based management system on AWS. (I'd bet you'd find a prebuilt AMI for this if you look around.)
I'm not sure about running a DNS server on AWS, but I think it would be much easier and more reliable to use a DNS service.
EasyDNS.com and No-IP.com are both great DNS hosts - I've used No-IP for my enterprise AWS web hosting for over 2 years. (It is particularly good because they offer monitoring, and automatic and manual DNS failover in case there's a problem. But, that may be more than you need.) I've used EasyDNS for 4 or 5 years. Both services have solid support and are very reliable.
If you want something free, MyDomain.com has been very reliable for me for almost 10 years, but support is very slow. MyDomain will host your DNS for free even if you didn't register the domain with them.
One last consideration in addition to these: Amazon also offers Elastic IPs, which is basically a static IP for your web server instance. Using this will make your DNS much simpler, give you flexibility to easily change to a new instance in the future, if you ever need to. I strongly recommend using an Elastic IP.
我使用过 EasyDNS,他们的 DNS 速率合理并且总是能快速提供帮助。
I've used EasyDNS, their DNS rates are reasonable and always been fast to help.
https://dns.he.net/ - 最多 50 个域免费。支持IPv6 AAAA记录、自定义TTL并具有便捷的管理界面。
https://dns.he.net/ - free for up to 50 domains. Supports IPv6 AAAA records, custom TTL and has convenient management interface.
Web 请求的生命周期由很多部分组成。我将尝试解释各个部分,以便您可以根据您认为最合适的方式填写空白。
该域名指向哪里?即哪个服务器应答转发到该域的请求? (这是由
DNS 记录
决定的,即在您的情况下,A 记录应指向服务器)。您很可能需要修改它。以前,您使用的是自己的主机,因此 DNS 中的 A 条目很可能指向他们的服务器。就像 SaintSal 提到的,最简单的方法是将其更改为从 AWS 获得的弹性 IP。我不知道为什么你的主机不允许修改 TLD,但它不应该破坏 cpanel。 [也许如果您已经使用他们超过 90 天,您可以将您的注册转移到另一个提供商 - 我个人使用 dreamhost。有了 Dreamhost,这样的设置就变得轻而易举。我对 dreamhost 唯一拥有的就是域名。它们由rackspace 和aws 托管]
最后,您仍然可以在当前主机上进行域名注册(不是托管),而是在AWS上进行网络托管。
如果您想让事情变得更复杂,您的 DNS 托管可以是其他服务。在这种情况下,您需要将域名注册商的 DNS 服务器更改为第三方,例如 DynDNS 或其他。
DNS 服务器将对 example.com 的请求解析为 IP,例如 11.11.11.11。在您的情况下,这应该是 AWS 弹性 IP。为了实现此目的,您的域名注册商将使用 DynDNS 服务器作为 DNS 服务器。 DynDNS 将有 A 记录指向您的弹性 IP。
我希望我没有让你感到困惑。
祝你好运。你大部分时间都在那里。只需要在这里和那里进行一些设置:)
The life cycle of a web request has many pieces. I will try to explain the individual pieces so you can fill in the blank according to how you best see fit.
Where does this domain point to ? i.e which server answers requests forwarded to this domain? (this is determined by
DNS records
i.e in your case A record should point to the server). You most likely need to modify this.Previously, you were using your host, so most likely in DNS the A entry pointed to their server. Like SaintSal mentioned easiest way is to change it to the elastic IP you get from AWS. I don't know why your host does not allow modification of TLD, but it shouldn't break cpanel. [perhaps if you have been with them for more than 90days, you can transfer your registration to another provider - I personally use dreamhost. With dreamhost, such a setup is a breeze. The only thing I have with dreamhost is the domains. They are hosted with rackspace and aws]
At the end of it, you will still have domain registration (not hosting) with your current host, but web hosting on AWS.
If you want to make things more complicated, your DNS hosting could be another service. In this case, you will need to change the DNS servers with your domain registrar to a third party such as DynDNS or others.
The DNS servers will resolve a request to example.com into an IP such as 11.11.11.11. In your case, this should be the AWS elastic IP. In order to make this work, your domain registrar will have DynDNS servers as DNS servers. DynDNS will have A record pointing to your elastic IP.
I hope I am not confusing you.
good luck. You are mostly there. just need a few settings here and there :)