View this page "Amazon EC2 LAMP Stack"

19 views
Skip to first unread message

Scott Haines

unread,
May 26, 2010, 2:07:18 AM5/26/10
to Hacker Dojo PHP
How to and Walk through for Launching the EC2 64bit LAMP Stack.
If you don't have an Amazon ec2 Developer account yet let me know and
I will give you some credits, we only have 4 credits left so if you
don't have one, please pick it up.

The server details are in this page, I went into fairly exhaustive
detail for everything but if you can't get this to work let me know.

Happy Programming and sorry again for having to cancel class today.

Click on http://groups.google.com/group/hacker-dojo-php/web/amazon-ec2-lamp-stack?hl=en
- or copy & paste it into your browser's address bar if that doesn't
work.

Scott Haines

unread,
May 26, 2010, 8:28:40 PM5/26/10
to Hacker Dojo PHP
If anyone has any huge questions after walking through this code
please let me know. I can answer your questions for mac or linux, but
if you are on Windows, I am sorry you'll have to view the Amazon
Developer notes.

andy

unread,
May 30, 2010, 4:53:01 PM5/30/10
to Hacker Dojo PHP
Hey Scott,

I was working through the tutorial, and ran into problems with
creating the bash_profile. I kept getting this error:

export: `PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/
bin:/bin': not a valid identifier

Here was the full text of my bash_profile:
export EC2_HOME=/.ec2
PATH=$PATH:$EC2_Home/bin
export EC2_CERT=/.ec2/cert-KLHYD42BLMXHZPOUR4Y7URAEZFZC36MI.pem
export EC2_PRIVATE_KEY=/.ec2/pk-KLHYD42BLMXHZPOUR4Y7URAEZFZC36MI.pem
export JAVA_HOME=/usr/bin/java
export EDITOR=nano

After looking around for a bit I found that if I changed it to this:
export EC2_HOME=/.ec2
export PATH:$PATH:$EC2_HOME/bin
EXPORT PATH
export EC2_CERT=/.ec2/cert-KLHYD42BLMXHZPOUR4Y7URAEZFZC36MI.pem
export EC2_PRIVATE_KEY=/.ec2/pk-KLHYD42BLMXHZPOUR4Y7URAEZFZC36MI.pem
export JAVA_HOME=/usr/bin/java
export EDITOR=nano

Then it would source fine. I'm continuing the tutorial, assuming that
it worked, but let me know if you think this is ok.

Andy

Scott Haines

unread,
May 31, 2010, 5:33:19 PM5/31/10
to Hacker Dojo PHP
The Tutorial was done on Mac OS 10.6 Snow Leopard, your paths will
vary depending on your installs and actual path to /bin/bash. Thanks
for the Post Andy, I think it will be helpful if others are
experiencing the same issues.

Aaron Infidel

unread,
May 31, 2010, 6:00:47 PM5/31/10
to hacker-...@googlegroups.com
what do you mean on this question scott?

* Get your Amazon EC2 Access ID and Secret Access Key info at this time. 
was > account > security credentials > Access Credentials > (Tab 1) Access Keys
Access Key ID
Secret Key ID (click show)


7. Move to your /.ec2 folder and create a new blank text file to store these in
>> nano credentials.txt (alternatively use emacs or vim)
* paste your access info into this file. 
* save and then we will modify the access info so only Super User can read the file
>> chmod 400 credentials.txt



do you paste both access/secret id?

I'm confused.

-Aaron


Aaron Infidel

unread,
May 31, 2010, 6:04:33 PM5/31/10
to hacker-...@googlegroups.com
also, on step nine I get errors:


3. Add the following Lines to your Profile
export EC2_Home=/.ec2/
export PATH:$PATH:$EC2_HOME/bin
export EC2_CERT=/.ec2/cert-xxxxx.pem
export EC2_PRIVATE_KEY=/.ec2/pk-xxxxxx.pem
export JAVA_HOME=/usr/bin/java
export EDITOR=nano

-bash: export: `PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/bin': not a valid identifier


On May 31, 2010, at 2:33 PM, Scott Haines wrote:

Scott Haines

unread,
May 31, 2010, 6:17:13 PM5/31/10
to hacker-...@googlegroups.com
This step is just reminding you to get your Access ID and Secret ID from Amazon (since you are there already). All you are doing is creating a text file in your /.ec2 folder and pasting these secrets in for your own reference, it is a safe place to store them (as long as the file is modified to 0400 chmod 400 <file_name> from the command line (this allows only Super User to get to this file).
--
Scott Haines
Founder / Creative Director / Lead Architect
Newfront Creative LLC
P 408.905.8473 C 408.705.7833
http://www.newfrontcreative.com
http://www.twitter.com/newfront

Aaron Infidel

unread,
May 31, 2010, 6:19:37 PM5/31/10
to hacker-...@googlegroups.com
I see... also, 

when I do this command: ec2-run-instances ami-6f6c8506 -k phphackerdojo_key.pem

I get an error saying that the keypair was not given, even though I've checked and it IS there... any ideas?

-Aaron

Aaron Infidel

unread,
May 31, 2010, 6:50:33 PM5/31/10
to hacker-...@googlegroups.com
where can I find the AMI Manifest path of your machine image?


I think you should of done this tutorial using the Firefox EC2 UI Plugin so windows users could follow along better, plus, its easier to use.

-Aaron


On May 31, 2010, at 3:17 PM, Scott Haines wrote:

Doug Chang

unread,
May 31, 2010, 7:24:18 PM5/31/10
to hacker-...@googlegroups.com
Instructions here: http://wiki.hackerdojo.com/amazonawsvisit

on bottom of page if you get stuck.


Scott Haines

unread,
May 31, 2010, 7:51:34 PM5/31/10
to hacker-...@googlegroups.com
Aaron,
I can only offer my time in so many ways, as I do not have a Windows box lying around I have put this into the best context available. I am a mac user and (Linux or Mac) so I did this tutorial so the most people possible can utilize these steps. Most people who write software are familiar with Linux machines and if you get into web real hardcore you will learn to love Linux. I don't have time to create tutorials for all possible setups and all possible user environments, so please use the link Doug sent over if you need more help with the windows machine.

Scott Haines

unread,
Jun 1, 2010, 6:30:01 PM6/1/10
to Hacker Dojo PHP
In Case you have had any issues,
The Amazon default server is under strict security accept ions within
the Firewall. If you need to open a port (eg. port 3306 for mysql)
then do so like this.

ec2-authorize <your_instance_security_group> -p 3306
> >>  was > account > security credentials > *Access Credentials *> (Tab 1)
> >> Access Keys
> >>  *Access Key ID*
> >> * Secret Key ID* (click show)

Aaron Infidel

unread,
Jun 1, 2010, 6:37:04 PM6/1/10
to hacker-...@googlegroups.com
I'm not on a Windows box, I was saying... for the users that are, you should of wrote a tutorial using the amazon EC2 UI extension because for the most part it would of been the same on both mac\windows\linux...

Scott Haines

unread,
Jun 1, 2010, 8:47:00 PM6/1/10
to Hacker Dojo PHP
I made an error that is easy to fix, in the /usr/local/apache/
directory, I have a sym link called 'modules' you need to cp the
libphp5.so from the modules2 folder into this directory. Then mysql
will be running again. Sorry for any confusion.

edenCC

unread,
Jul 10, 2011, 10:36:16 AM7/10/11
to Hacker Dojo PHP
just for your info, I just got a guide on how to install ec2 api tools
on a macbook: http://planet.admon.org/setup-amazon-ec2-api-tools-on-macbook/
Reply all
Reply to author
Forward
0 new messages