Port LAMP application to EC2 - mysql

Any good resource on how to port a LAMP stack to Ec2?
Mainly I'm concerned about storage, the MySQL part. The existing app works agains a single store. Do I need to port all my storage to S3? Will the EC2 instances be able to share a single MySQL database? Alternatively I can partition my data and have a single database for each EC2 image, but I still need a global user account database for authentication and if the data is partitioned the requests have to be routed to the proper image. Not sure how this is achieved in EC2.
To wrap up: where should I start?

These Tips for deploying a LAMP stack on Amazon EC2 are IMO a really good starting point. I'd suggest to read them first (I'm not sure I understand your concerns about the storage part), maybe things will be clearer after.

I know this is old, but for anyone who's in this situation check out: http://www.robotmedia.net/2011/04/how-to-create-an-amazon-ec2-instance-with-apache-php-and-mysql-lamp/
That is the most straight forward tutorial I've found for implementing a LAMP stack on Amazon EC2.
Using S3 isn't required, although it is an affordable way to host files. Yes, multiple instances can share a single database and you can use database replication for additional availability. Here's a great tutorial for that: http://aciddrop.com/2008/01/10/step-by-step-how-to-setup-mysql-database-replication/

Related

How to use Bitnami Memcached between my Azure WebApp and MySQL DB, both being PaaS service?

I am having an application running under Microsoft Azure WebApp service which is connected to a MySQL Database as a service. Now, I want to use Memcache for my Database, so that database query can speed up, based on excessive application load. For that, I am using Bitnami Memcached cluster with multiple instances. Now, I just need to know, what all I need to configure for memcached to perform proper caching for my DB. Do anything need to be changed on application code level as well?
Let me know, if my question is anyhow unclear or for any further clarification. Thanks.

AWS WordPress High Availability EFS, EC2 and MySQL database

I'm building a Wordpress high availability service. I know a little about Wordpress, but not sure how to get it working and setup for HA. I've done reading from various articles, but not sure how tolerant Wordpress is when changes occur on one host and now the other host will react.
I'm starting with 2 EC2 instances, EFS(NFS) and RDS MySQL database. The EFS is used to share the application configuration/data/content on both instances. RDS MySQL database will be shared on both instances as well. Does anyone see any hurdles with this design? I'm wondering how Wordpress plugins gets updated on one host and if the other host will see the same updates dynamically.
I used the same infrastructure design for a high traffic blog and it works like a charm.
I've done reading from various articles, but not sure how tolerant Wordpress is when changes occur on one host and now the other host will react.
As long as your wordpress files are stored into EFS, all EC2 instances will be up-to-date.
Suggestions:
Use CloudFront for serving your assets. Do not rely on EFS or you'll burn all your EFS burst credits.
Use an Autoscaling Group for scaling up/down your instances.
Strictly monitor the EFS burst/throughput credits using CloudWatch alarms. If you burn all your credits, your instances are not able to read from the EFS storage!

Setting up servers with fault tolerance using Go and MySQL (failover)

I am working in a project where we are using Go as a web server and MySQL.
We have been told to implement fault tolerance to handle a hardware crash. We were given 2 servers which have MySQL and the Go-server on them.
We have succesfully set up replication in MySQL, but we are struggling with the failover part. Our thought was to get an extra server with HAProxy to have a primary server and then being able to failover to the backup server.
We also considered using MySQL failover, but did not see how we could redirect the traffic using it.
Is this a reasonable plan? Or what would you recommend that we do instead?
If you want two identical servers connecting to their local MySQL instances, you need a way of deciding which one is the production server. There are a number of solutions for that, including
Setting up a reverse proxy, as you mention, but then, your proxy
itself becomes a SPOF,
Using a floating IP, also known as a failover
IP, but this only works if your host supports it. Cloud providers
typically support them, as well as some bare metal server providers.
There is nothing specific to Go as far as I know.

Migrate from cpanel/whm to Heroku or AWS

I have a dedicated server with WHM and cPanel installed on it.
recently I decided to move to cloud services since the dedicated server is costly and I'm not actually using any of its power, freedom and functionality.
I was considering moving to AWS or Heroku since they are less expensive, scalable and I don't need to manage the server myself.
I only have few websites on my server and I'm managing them via cPanel and WHM
I'm only using mySql database
I have also have some cron jobs setup
I use ftp to upload and maintain my websites (no git)
I was wondering if anyone could explain how I can transfer my files, databases, and domains to either AWS or Heroku.
I prefer the one that is easier and faster to migrate to.
Thanks.
If server/network management is not your strength, I would strongly advise against using AWS (even as big a proponent of AWS as I am). You absolutely must manage the servers yourselves, at least the configuration aspect (not the hardware aspect). In fact, you will find that you have to do things like set up security policies, identity access management, IP addresses, etc. that are not always that intuitive to one who is not used to working in a bit of an operations capacity.
You will also likely have to consider application architecture changes to work best with AWS services. Additionally, you will have to become accustomed to the AWS way of doings things (that starting and stopping server instances may make all your data go away and such).
If you are looking for a hands-off server approach, you might be better served looking at something like Slicehost/Rackspace.
I can't talk much to Heroku as I have only minimal experience prototyping on it. You can think of it more as an application platform. For simple applications that don't have unique traffic demands or architectural requirements, it seems a good solution for getting an application up and running with minimal server-related configuration. Again a legacy app will probably require some re-architecting to do things the Heroku way.
AWS are good but the support at Rackspace is far better and much more suited for someone like you. Rackspaces support is 24/7 and even on their online chat system you don't need to wait more than a few mins to speak to someone who actually knows what they are doing.

Database Choice for WebSite

I have developed several websites on my local host for school. I can program database driven aspects of a webisite such as a blog on my own no problem. At school I used a MySQL DB which was hosted on a dedicated server, so when the server went down I could not have access to my data. I also have a mysql DB on my localhost but...my question is this: If i use the MySQL DB on my localhost, won't I only have access to the data when my computer is running so that my site can make server requests?
How can I set up any kind of DB for my site that is reliable and doesn't depend on my localhost to act as a DB Server?
I am now developing in .NET
Thanks. PS I don't have access to schools' server any more.
PPS I still don't have a site set up through a hosting provider...probalby going to go with godaddy
You'll need a server for that. A server will cost you on a monthly basis, I haven't heard of any free mysql servers, someone else may be able to help you with that.
Regular hosting providers supply PHP and MySQL server. I run my sites on Dreamhost (www.dreamhost.com)
It might also be worthwhile to look into Amazon EC2 : http://aws.amazon.com/ec2/
Also Amazon RDS for pure database only usage : http://aws.amazon.com/rds/
They provide a pay as you use service and the tier 1 service is free for the first year as I understand
There's no magic, you have to host your DB on a server that will run 24/7. Could be on the internet, it depends on the firewalls surrounding you.
The website will always depend on some sort of database server, why so worried that your database will be unreachable? Your webserver can go down also and will have the same consequences as the db.
Why don't you get some paid hosting? It is fairly cheap these days, for around 30dollar/year you will have some reliable hosting. When the DB will break down, it is not your responsibility.
If you don't want te be dependent of MySQL, you will need to use plain-text database that will be maintained by PHP or something.
You might consider running the MYSQL in i.e. a cloud provider, like Amazon EC2. It will certainly cost some money.