17
web2py Amazon EC2 Basic How-to

Howto deploy Web2py on amazon Ec2

Embed Size (px)

DESCRIPTION

Step by step instructions to deploy web2py one one Amazon EC2 Instance

Citation preview

Page 1: Howto deploy Web2py on amazon Ec2

web2py Amazon EC2Basic How-to

Page 2: Howto deploy Web2py on amazon Ec2

Create an EC2 Account

http://aws.amazon.com/ec2/

Use you Amazon login to register for EC2

Give your credit card info

You will be billed differently depending on the instance you choose and the site traffic. Later we will use the smaller possible instance.

Page 3: Howto deploy Web2py on amazon Ec2

Ready to deploy an Instance

An instance is a ready made virtual machine that will run on the amazon cloud.

Choose "AMS Management Console"

Page 4: Howto deploy Web2py on amazon Ec2

Start to deploy an Instance

Click on "Launch Instance"

Page 5: Howto deploy Web2py on amazon Ec2

Choose an Instance

Choose one of the ubuntu servers

we tried ami-2675974f

32 bits are "small instance"

EMB ones have persistence storage

Page 6: Howto deploy Web2py on amazon Ec2

... keep going ...

Page 7: Howto deploy Web2py on amazon Ec2

... keep going ...

Page 8: Howto deploy Web2py on amazon Ec2

... careful now (security) ...Give a name to your security .pem certificate

Save it on a safe place on your machine

Remember your.pem

Page 9: Howto deploy Web2py on amazon Ec2

... keep going ...

Leave security group as "default"

Page 10: Howto deploy Web2py on amazon Ec2

Back to Your Instances

Wait for your Instance to start

Its IP address is under "public DNS"

Remember instanceip

Page 11: Howto deploy Web2py on amazon Ec2

Allow AccessClick on Security Groups

Select the "default" group (the only one)

At the bottom enable ssl, http, https

Page 12: Howto deploy Web2py on amazon Ec2

Almost done...Connect to your instance

localhost> ssh -i [your.pem] [instanceip]

Page 13: Howto deploy Web2py on amazon Ec2

Almost done...Install web2py

localhost> ssh -i [your.pem] [instanceip]> wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh> chmod +x setup-web2py-ubuntu.sh> ./setup-web2py-ubuntu.sh

Page 14: Howto deploy Web2py on amazon Ec2

Almost done...This will take a while and may ask you some questions

localhost> ssh -i [your.pem] [instanceip]> wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh> chmod +x setup-web2py-ubuntu.sh> ./setup-web2py-ubuntu.shbla bla bla

Page 15: Howto deploy Web2py on amazon Ec2

Almost done...Enable the admin interface

localhost> ssh -i [your.pem] [instanceip]> wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh> chmod +x setup-web2py-ubuntu.sh> ./setup-web2py-ubuntu.shbla bla bla> sudo -u www-data bash> cd /home/www-data/web2py> python -c "from gluon.main import save_password; save_password('hello',443)"

Page 16: Howto deploy Web2py on amazon Ec2

Done

Now you are ready to connect to

http://[instanceip]

https://[instanceip]/admin

Page 17: Howto deploy Web2py on amazon Ec2

Caveats

What have we done?

We have setup a virtual machine running on the Amazon cloud with web2py running on it.

What have we NOT done?

We have not setup elastic computing and storage.

Can it be done?

Yes. But it is not described here.