HOW-TO install MySQL on an Amazon AWS Server using EBS

I am using an Amazon Linux AIM so the steps below assume this is the kind of image you have. Most of the steps below actually should work on any Linux server.
It is interesting to use an EBS filesystem so your data is persisted even after termination of your server instance. Using the instance filesystem to store data from MySQL should not be interesting for a database server, as all your data would be lost in case of termination of your instance.

Using new EBS volume with your Amazon AWS instance server

So you just decided to create a new EBS volume to be used with one of your Amazon AWS Instances. Why would you do this? I could think of many reasons, but the one for me is using it as a repository for my git files, so they are preserved in case my instance is shut down or corrupt.
To do this, follow the steps below:

  1. Create the EBS Volume:
  2. Go to your AWS Management Console, choose your region and find the "Elastic Block Stores"(EBS) / Volumes option.

Install MySQL Gem in Mac OS - using MacPorts

While trying to install the MySQL gem in a Mac OS Lion, you might get an error message:

$ sudo gem install mysql -v '2.8.1'
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
....
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

How-to install Ruby and Rails on a Amazon EC2 Server

To install Ruby and Rails on your Amazon EC2 server there are a few steps you need to follow, but none of them quite hard. By default ruby is already installed on your server by Amazon - check it by running $ ruby -v.

$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-linux]

Mac OS edit /etc/hosts and DNS Cache Flush

In Mac Os when you edit the /etc/hosts file either by adding a new entry or changing an existing one, the changes are not reflected immediately.
So you think:
- This is simple! All I have to do is close the Terminal and open a new one!
And then you realize it did NOT work.
Since you are a smart person, you might think:
- Well, all I have to do is log out and back in! Still simple!
Only to realize again that it did NOT work.

How to connect to Amazon EC2 using Putty SSH

If you use Windows to connect to your servers, the most used software to connect using SSH are usually Putty or Cygwin. This tutorial will use Putty to allow you to connect to an amazon EC2 server.
When you build your servers you created a ".pem" file which is the public-key of a specific certificate. Putty does not understand this key, so it is necessary to create a "ppk" file - Putty Private Key.

Installing Apache in your Amazon EC2 Cloud Server

Now that you have your Amazon EC2 Cloud server, you need to start setting it up. (Did u get free cloud server?)

I think starting with an apache server would be a good (and very simple) option. All you have to do is type the command:

$ sudo yum -y install httpd

It will install a brand new apache server in lightning speed.

Now let us start the server services and have them start up automatically on a reboot:

Amazon Elastic Cloud (EC2) for free

Amazon has a program to help users get started in the cloud for free. It is called AWS Free Usage Tier and it is offered as no charge for new Amazon EC2 customers.
You can run a micro instance for free for a year with a fairly good pack of services for free:

Update a Git Repository from local versioned files

If you are new to using Git as a versioning tool, you might make a common mistake whilst managing local files - I know I did.
When you start working on a cloned remote git repository (created from the git clone command) all the following commits (done by the git commit command) are executed on your local repository.
To upload the commits to the remote repository you need to perform a push command, like the following using ssh:

Setting up a git server on MacOS X Lion

Recently I found this nice tutorial on how to setup a git server on a Mac OS X Lion.
It goes straight to the point and you can setup the server using apache real quick!

Enjoy!

Update on October, 15th 2011: Since the referred website has been down a few times the past few days, I have added below the most important steps for setting up the git server on a MacOS X Lion.

Pages

Subscribe to www.definenull.com RSS