Jeff's Tech Blog

September 11, 2011

Amazon EC2 – Part 1

Filed under: Uncategorized — jaguth @ 9:55 am

I need to learn Amazon EC2 so I can refresh on my Linux knowledge while learning something new.

First things first:  Create a VM in Amazon’s EC2 cloud:

  1. Go to http://aws.amazon.com/ec2/
  2. Create AWS account.  Run through Sign Up. Give credit card.  Ect.
  3. In EC2 dashboard, click Launch Instance
  4. Choose “Basic 32-bit Amazon Linux AMI 2011.02.1 Beta” Micro Instance, since its free for 1 year.
  5. Done.  Thats it.  The AMI instance “Basic 32-bit Amazon Linux AMI 2011.02.1 Beta” was created for me.  Easy!  +1 for easy.

Okay, now how do I use it?  Hmm…  Right click instance, select “Connect”:

Connect Help

Connect Help

I’m using Windows, so PuTTY is my only option.  But its not working with .pem key i created….

I posted a thread (https://forums.aws.amazon.com/message.jspa?messageID=278374) in their EC2 forum and got a really fast response.  +1 for fast response.  After some back and forth discussion, i discovered how to connect:

  1. Configure your security settings to allow port 22 (SSH) access to the VM.
  2. Convert the .pem key to a .ppk key (http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/index.html?ConnectToInstanceLinux.html).
  3. Thats it, now I can SSH in via PuTTY!

So, while the connection information wasn’t strait forward, I was still able to connect.

Next task: Get a LAMP environment going:

  1. http://www.howtoforge.com/how-to-create-a-lamp-setup-apache-2-php-mysql-on-centos-5.x-in-an-amazon-linux-ami

Wow, that was easy!  Now lets test it:

  1. Use Pageant to keep the ppk key in memory.
  2. Connect to my instance using SFTP via FileZilla.
  3. Copy some html scripts I created.

Success!  You can view my tests at http://ec2-107-20-88-81.compute-1.amazonaws.com/

Now to test perl:

  1. Using Komodo IDE, connect to my instance via SFTP
  2. Create a simple script
  3. run perl test.pl

Success!

Now, there are 2 things not working:

1)  Remote SQL editing.  I cannot seem to connect to my mysql instance via Toad IDE.  My credentials fail.  Not sure why

2) Mason:

Amazon uses Mason, so I need learn it.  It *should* be easy, but I can’t even install it.  Should be as easy using entering CPAN, and running “get HTML::Mason; make HTML::Mason; install HTML::Mason”.  get downloads it without issue, but then the issues start with make:

This module requires Module::Build to install itself.
  Install Module::Build now from CPAN? [y]

Okay, sure, go for it

---- Unsatisfied dependencies detected during ----
----    DAGOLDEN/Module-Build-0.3800.tar.gz   ----
    Module::Metadata [requires]
    CPAN::Meta [requires]
    Perl::OSType [requires]
    ExtUtils::CBuilder [requires]
    Parse::CPAN::Meta [requires]
    version [requires]
    Test::More [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]

Well, you gotta do what you gotta do.  Lets add them to the queue

---- Unsatisfied dependencies detected during ----
---- DAGOLDEN/Module-Metadata-1.000007.tar.gz ----
    version [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]

Ok, fine…

---- Unsatisfied dependencies detected during ----
----       JPEACOCK/version-0.94.tar.gz       ----
    Test::More [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]

Just do it already…  After 20+ times of pressing “enter”, the make process fails with this:

[BIG SNIP]

Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Couldn't install Module::Build, giving up.
Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site]
Warning (usually harmless): 'YAML' not installed, will not store persistent state
  JSWARTZ/HTML-Mason-1.46.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Could not read '/root/.cpan/build/HTML-Mason-1.46-qTpob6/META.yml'. Falling back to other methods to determine prerequisites
Failed during this command:
 JSWARTZ/HTML-Mason-1.46.tar.gz               : writemakefile NO '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512

Many of the dependencies fail to make, thus HTML::Mason fails to make.  There is so much text scrolling during the final make that I can’t see what the root cause is.  All from trying to get Module::Build installed.  I scoured the net for an answer and found none.  Seriously?

Not t sure what to do, but i will continue hammering until i solve it.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.