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:
- Go to http://aws.amazon.com/ec2/
- Create AWS account. Run through Sign Up. Give credit card. Ect.
- In EC2 dashboard, click Launch Instance
- Choose “Basic 32-bit Amazon Linux AMI 2011.02.1 Beta” Micro Instance, since its free for 1 year.
- 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”:
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:
- Configure your security settings to allow port 22 (SSH) access to the VM.
- Convert the .pem key to a .ppk key (http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/index.html?ConnectToInstanceLinux.html).
- 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:
- 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:
- Use Pageant to keep the ppk key in memory.
- Connect to my instance using SFTP via FileZilla.
- 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:
- Using Komodo IDE, connect to my instance via SFTP
- Create a simple script
- 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.
