将托管 LAMP 站点迁移到 AWS
有没有一种简单的方法可以将托管的 LAMP 站点迁移到 Amazon Web Services?我有一些业余爱好网站和面向家庭成员的网站,与我们在 AWS 上支付的费用相比,我们每月的支出太多了。
我想要迁移到 AWS 的典型廉价示例:
- GoDaddy 域
- 托管在 1&1 或 MochaHost 的
- 站点特定目录结构中的一些 PHP 文件
- 一个小型 MySQL 数据库
- .htaccess 文件 。
我在网上找到的教程需要 PuTTY、Linux 命令等。虽然这些并不是可以想象到的最麻烦的障碍,但它似乎过于复杂 做到这一点最简单的方法是什么?
理想的解决方案类似于设置网络主机:将 GoDaddy 指向它,上传文件,导入数据库,完成。 (已安装 phpMyAdmin 的奖励积分,但当然不是必需的。)
Is there an easy way to migrate a hosted LAMP site to Amazon Web Services? I have hobby sites and sites for family members where we're spending far too much per month compared to what we would be paying on AWS.
Typical el cheapo example of what I'd like to move over to AWS:
- GoDaddy domain
- site hosted at 1&1 or MochaHost
- a handful of PHP files within a certain directory structure
- a small MySQL database
- .htaccess file for URL rewriting and the like
The tutorials I've found online necessitate PuTTY, Linux commands, etc. While these aren't the most cumbersome hurdles imaginable, it seems overly complicated. What's the easiest way to do this?
The ideal solution would be something like what you do to set up a web host: point GoDaddy to it, upload files, import database, done. (Bonus points for phpMyAdmin being already installed but certainly not necessary.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看来亚马逊 AWS 市场现在已经为您的问题提供了解决方案:
<一href="https://aws.amazon.com/marketplace/pp/B0078UIFF2/ref=gtw_msl_title/182-2227858-3810327?ie=UTF8&pf_rd_r=1RMV12H8SJE KSDPC569Y&pf_rd_m=A33KC2ESLMUT5Y&pf_rd_t=101&pf_rd_i=awsmp-gateway-1&pf_rd_p=1362852262&pf_rd_s=right-3" rel="nofollow">https://aws.amazon.com/marketplace/pp/B0078UIFF2/ref=gtw_msl_title/182-2227858-3810327?ie=UTF8&pf_rd_r=1RMV12H8 SJEKSDPC569Y&pf_rd_m=A33KC2ESLMUT5Y&pf_rd_t=101&pf_rd_i=awsmp-gateway-1&pf_rd_p=1362852262&pf_rd_s=right-3
或者从他们自己的网站
http://www.turnkeylinux.org/lampstack
完整的 LAMP 堆栈,包括 PHPMyAdmin,无需设置。
至于您的站点和数据库迁移本身(只需要文件副本和数据库备份/恢复),减少麻烦的唯一方法是让其他人为您做这件事......
It would seem the amazon AWS marketplace has now got a solution for your problem :
https://aws.amazon.com/marketplace/pp/B0078UIFF2/ref=gtw_msl_title/182-2227858-3810327?ie=UTF8&pf_rd_r=1RMV12H8SJEKSDPC569Y&pf_rd_m=A33KC2ESLMUT5Y&pf_rd_t=101&pf_rd_i=awsmp-gateway-1&pf_rd_p=1362852262&pf_rd_s=right-3
Or from their own site
http://www.turnkeylinux.org/lampstack
A full LAMP stack including PHPMyAdmin with no setup required.
As for your site and database migration itself (which should require no more than file copies and a database backup/restore) the only way to make this less cumbersome is to have someone else do it for you...
Dinah,
作为一家网络开发公司,我经历过无数的托管公司。我还密切参与了 LAMP 和 Windows 堆栈中站点的云托管解决方案的研究。
您引用了 GoDaddy、1And1 和 Mochahost 的微型 Linux 站点信息,因此我猜测您使用的基准是每个站点每月 2 - 4 美元。听起来您有“几个”站点(大约 5 个?)并且至少需要一个数据库。
我还没有看到任何工具能够将最基本的(即仅文件,无数据库)网站转移到云托管中。正如大多数人所建议的那样,您无法做太多事情来避免初始环境设置。 (您也应该考虑您的时间。如果您花费 10 个小时来做这件事,您可以向客户收取 10 x 美元每小时的费用,并且刚刚为您的朋友和家人购买了托管服务。)
当您查看 AWS(或任何人)时,请记住这些事情:
计算周期只是它的起点。当您从传统 ISP 购买托管服务时,他们向您出售周期、磁盘空间和数据库托管服务。在您因“超额”或过度使用而停止或收费之前,它们的允许周期、数据库大小和流量的默认级别通常也高得多。
考虑 1 个数据库的成本,并考虑您需要更多数据库的可能性。数据库托管费用会很快增加云成本。
虽然您的基本站点可能需要很少的 CC(计算周期),但免费套餐的托管上限仍然相当低。预计会突破免费托管并按月收费。
磁盘空间也被计费。使用定价估算器考虑 CC、DB 和 HDD 的成本:http://calculator.s3 .amazonaws.com/calc5.html
如果您的朋友和家人想要访问该系统,他们将无法获得该系统,除非您使用允许“白色标签”并提供一种方法的托管公司将您的主帐户分为较小的迷你托管帐户。如果您使用像 www.rackspace.com 这样的主机,它们甚至可以设置为提供自我管理和直接计费选项。问题是,您听起来不想向任何人收取费用,而且他们的最低帐户可能对于您的需求来说太大了。
请记住,GoDaddy(和其他公司)经常会赠送一年的托管服务,即使是简单的域名注册。在我拥有自己的服务器之前,我曾经充分利用这些服务器。在我作为客户的一生中,我可能已经获得了 40 多个免费托管帐户等。 (我仍然通过他们注册大量域名。我还转售他们的托管服务。)
如果您还没有,请考虑使用支持门户的 CMS 系统(一个实例,不同域下的许多网站)。虽然我个人更喜欢 DotNetNuke,但我确信它的 LAMP 堆栈竞争对手之一可以为您做同样的事情。这将使您只使用一个数据库并进一步简化您的需求。
我希望这可以帮助您做出明智的选择。我认为这将是收益和成本之间的微妙界限。只有知道每个站点、每个数据库的确切大小和典型流量才能提前确定。数据库数量和流量将是您的主要“敌人”。优化文件以减少磁盘空间需求和数据传输的流量水平。
祝你好运。
Dinah,
As a Web Development company I've experienced an unreal number of hosting companies. I've also been very closely involved with investigating cloud hosting solutions for sites in the LAMP and Windows stacks.
You've quoted GoDaddy, 1And1 and Mochahost for micro-sized Linux sites so I'm guessing you're using a benchmark of $2 - $4 per month, per site. It sounds like you have a "few" sites (5ish?) and need at least one database.
I've yet to see any tool that will move more than the most basic (i.e. file only, no db) websites into Cloud hosting. As most people are suggesting, there isn't much you can do to avoid the initial environment setup. (You should factor your time in too. If you spend 10 hours doing this, you could bill clients 10 x $hourly-rate and have just bought the hosting for your friends and family.)
When you look at AWS (or anyone) remember these things:
Compute cycles is only where it starts. When you buy hosting from traditional ISPs they are selling you cycles, disk space AND database hosting. Their default levels for allowed cycles, database size and traffic is also typically much higher before you are stopped or charged for "overage", or over-usage.
Factor in the cost of your 1 database, and consider how likely it will be that you need more. The database hosting charges can increase Cloud costs very quickly.
While you are likely going to need few CCs (compute cycles) for your basic sites, the free tier hosting maximums are still pretty low. Anticipate breaking past the free hosting and being charged monthly.
Disk space it also billed. Factor in your costs of CCs, DB and HDD by using their pricing estimator: http://calculator.s3.amazonaws.com/calc5.html
If your friends and family want to have access to the system they won't get it unless you use a hosting company that allows "white labeling" and provides a way to split your main account into smaller mini-hosting accounts. They can even be setup to give self-admin and direct billing options if you went with a host like www.rackspace.com. The problem is you don't sound like you want to bill anyone and their minimum account is likely way too big for your needs.
Remember that GoDaddy (and others) frequently give away a year of hosting with even simple domain registrations. Before I got my own servers I used to take HUGE advantage of these. I've probably been given like 40+ free hosting accounts, etc. in my lifetime as a client. (I still register a ton of domain through them. I also resell their hosting.)
If you aren't already, consider the use of CMS systems that support portaling (one instance, many websites under different domains). While I personally prefer DotNetNuke I'm sure that one of its LAMP stack competitors can do the same for you. This will keep you using only one database and simplify your needs further.
I hope this helps you make a well educated choice. I think it'll be a fine-line between benefits and costs. Only knowing the exact size of every site, every database and the typical traffic would allow this to be determined in advance. Database count and traffic will be your main "enemies". Optimize files to reduce disk-space needs AND your traffic levels in terms of data transferred.
Best of luck.
实际上,这取决于您的服务器架构,是否要将整个 LAMP 堆栈迁移到 Amazon EC2。
或者为不同的服务器组件使用不同的 Amazon Web 服务,例如用于存储的 Amazon S3 和用于 mysql 数据库的 Amazon RDS 等。
如果您要在 EC2 上使用 LAMP:本教程至少会给您一个提示。
无论如何,您仍然需要执行设置 AMI 并通过 SSH 安装 LAMP 的基本步骤。
Actually it depends upon your server architecture, whether you want to migrate whole of your LAMP stack to Amazon EC2.
Or use different Amazon web services for different server components like Amazon S3 for storage and Amazon RDS for mysql database and so.
In case if you are going with LAMP on EC2: This tutorial will atleast give you a head up.
Anyways you still have to go with essential steps of setting up the AMI and installing LAMP through SSH.