ActiveBlog

Getting Started with Private PaaS on Amazon EC2
by Diane Mueller

Diane Mueller, April 11, 2012

UPDATE: Troy Topnik, ActiveState's Technical Communications Manager, has provided s step-by-step guide to setting up your own Stackato Cluster on Amazon EC2 in a recent blog

Deploying and configuring your own single instance private PaaS on EC2 with Stackato is almost as easy as downloading a micro cloud virtual machine (VM) to your desktop. The ActiveState team has created an Amazon Machine Image (AMI) with Stackato installed that is ready to run on EC2, with a few minor configuration tweaks that even a Newbie to the cloud can figure out. The Stackato AMI is available for free subject to the terms and conditions of the Stackato Micro Cloud License Agreement.

How simple is it?

To get Stackato up and running on EC2, all you need to do is launch an EC2 AMI, configure an IP address and domain name, SSH into the instance, perform a few simple stackato-admin commands, and then launch the Stackato Web Management Console to complete your setup and configuration. Download the Stackato Client and you'll be able to push your applications directly to the cloud from your desktop.

Getting Access

Before you can get started, you must first have valid AWS credentials so that you can use Amazon's web services. You can either sign up for a new AWS account or use your existing AWS credentials. If you're creating a new Amazon account, you will need to provide a credit card to complete the sign-up process. At the end of each month, Amazon will charge your credit card for the cloud-related usage costs associated with your AWS account.

You'll also need to send an email request to the ActiveState Stackato Support team with your AWS Account Number (shown in the upper-right corner of the AWS "Manage Your Account" page).

AWS Account Number

Once you have received your email confirmation from ActiveState that you've been granted access - you can spin up your own private PaaS on a small EC2 instance in a few quick steps.

  1. Launch an AWS Instance of Stackato
  2. Associate your Domain Name with your Stackato Instance’s Elastic IP Address
  3. Log in to your Stackato Instance with SSH/PuTTY
  4. Adding your domain to /etc/hosts
  5. Use the "stackato-admin" Command Basics
  6. Sign in to the Stackato Web Management Console

Step 1: Launch an AWS Instance of Stackato

The AWS Management Console provides a web interface for Amazon Web Services. You can start and stop EC2 instances, view and perform actions on running instances, set configurations (e.g. security groups, key pairs, and Elastic IPs) and modify them using interactive controls.

Log in using your AWS account name and password. Navigate to the "Amazon EC2 Console Dashboard" and click on the "Launch Instance". This will launch the "Request Instances Wizard" for you.

AWS Launch Instance

From your AWS console, search the Amazon "Private Images" catalog for the latest Stackato AMI using the string "stackato". Select the Stackato AMI ID.

AWS Find Stackato AMI

Choose the Instance Type "(m1.small, 1.7 GB)". This is the least expensive option and a good one for testing purposes. For a production environment, you will need to deploy a cluster of instances and assign different roles to each of them to spread the workload more efficiently. The Stackato AMI is currently only available for use in the "us-east-1a" EC2 Availability Zone, so select that zone at this point.

AWS Instance Details

Click on "Continue" and accept all the defaults on the Advanced Instance Options for now.

Next, give your AMI a user-friendly name or "key". This makes it easy to identify later if you deploy more than one instance.

AWS Name Instance

There is a default password for the Stackato AMI. You will be prompted to change it when you launch the Stackato Web Management Console for the first time. Click "Continue" on the "Create Key Pair" page and go directly to "Configure Firewall" to set up a Security Group.

AWS Create a new Security Group

Using the "Create a new rule" drop-down list, select each of the following rules: SSH, HTTP, HTTPS and DNS. This security configuration will allow you to securely shell into your instance using SSH/PuTTY and configure your instance so that it can be accessed using a domain name of your choice.

AWS Instance Launch

Review your choices and hit "Launch". Be patient as it may take a few minutes for Amazon to fulfill your request. When the instance is available it will appear in your AWS Console as a "running instance" with the name you chose earlier.

AWS Management Console - Instances

You have a live Stackato Instance. Now you just have to make it "yours" by mappng your domain name to the instance.

Step 2: Associate your Domain Name with your Stackato Instance's Elastic IP Address

The Public DNS and your Private IP Address assigned automatically by AWS are ephemeral. They do not persist when an instance is restarted.

AWS Ephemeral DNS and IP

To map a DNS entry to Stackato, you need a persistent IP address. Amazon EC2 provides Elastic IP addresses, which do persist through reboots. Any Elastic IP addresses that you associate with your account remain associated with your account until you explicitly release them.

To allocate a new Elastic IP address for use with your PaaS

  1. Click Elastic IPs in the Navigation pane. The console displays a list of Elastic IP addresses assigned to your account.
  2. Click Allocate New Address.
  3. In the confirmation dialog box, ensure the value for EIP used in is set to EC2, and click Yes, Allocate.

To associate the Elastic IP address with an instance

  1. Click Instances in the Navigation pane. The console displays a list of instances.
  2. Write down the instance ID to associate with the Elastic IP address.
  3. Click Elastic IPs in the Navigation pane. The console displays a list of Elastic IP addresses assigned to your account.
  4. Select an address and click Associate Address.
  5. In the Associate Address dialog box, select the instance from the Instance list box and click Yes, Associate.
AWS Assign Elastic IP

For this example, I registered the domain "gorilla-mgmt.com" through Dreamhost.com, so I use Dreamhost's domain management console to make the DNS changes to point to the AWS instance. In this example, I am using a subdomain called "paas" to associate with the Stackato PaaS running on the AWS instance.

DNS CNAME - Dreamhost

Type in your "AWS Elastic IP" in to the "Value" field of the CNAME Record. You'll need to add add a "." at the end and then save your changes. Depending on your domain hosting provider, it may take awhile for this change to take effect.

Step 3: Log in to your Stackato Instance with SSH/PuTTY

You need to tell Stackato about your instance's "Private IP address" and your chosen domain name.

Log in to your machine via ssh as user "stackato" with default password "stackato". Note: Do not change the unix user password in this step - it will happen in a later step.

While Secure Shell or "ssh" may sound daunting, it really is just a secure way to log into a remote computer as an authenticated user. If you're using Linux or Mac OS X, use the 'ssh' client that comes with the OS, if you're using Windows get a copy of PuTTY.

Launch PuTTY from your desktop and type in your AWS Public DNS address in the Host field, then click "Open".

Putty Configuration

Click the "Open" button and you'll be prompted to login to your instance for the first time.

This first time, you'll login as the user "stackato" using the default password which is also "stackato". Do not change the password yet, this will be done in a later step.

Step 4: Adding your domain to /etc/hosts

You'll need to add a line in the '/etc/hosts' file to resolve the domain name added above to localhost via the 127.0.0.1 loopback address.

To make these edits, you'll need to use a console text editor like "Vim", which is already installed on your EC2 instance (if you don't know how to use it, here's a useful cheatsheet).

SSH Login

To edit the /etc/hosts files, you'll have to run vim with the "sudo" command - which allows you to run programs and commands with the security privileges of another user (in this case, the superuser, or root):

$ sudo vim /etc/hosts

You'll need to add one line to the top of the /etc/hosts file, substituting your domain name for the one used in this example.

127.0.0.1 localhost stackato paas.gorilla-mgmt.com api api.paas.gorilla-mgmt.com

When you save the file, you may get an error message such as the following: "unable to resolve host stackato-xxxx". This message can be ignored.

When you are finished editing your /etc/hosts file should look something like this:

Stackato - edit /etc/hosts

Step 5: Becoming Stackato: the "stackato-admin" command basics

While still logged in with PuTTY to your instance, you'll need to type in the final configuration using a few stackato-admin commands and then reboot your instance.

The email address used in this step should be the same as for the user who will become the first admin user of the system in Step 6.

The "private instance IP" is the one noted as Private IP Address for your EC2 instance.

From the command line, type in the following stackato-admin commands substituting your domain information :

$ stackato-admin admin grant admin1@gorilla-mgmt.com
$ stackato-admin become all -m 10.110.201.176 -e api.paas.gorilla-mgmt.com -h paas --domain paas.gorilla-mgmt.com

Now reboot so all the changes take effect.

$ sudo reboot

When you do the "reboot" from PuTTY, your session will automatically end and disconnect.

Step 6: Sign in to the Stackato Web Management Console

Direct your browser to https://api.<Fully Qualified Domain Name>/. In this example, you would go to https://api.paas.gorilla-mgmt.com.

This will take you to the initial console setup welcome page. Use the same email address here that was granted admin permission in the previous step. The password that you provide here will also become the stackato system password, replacing the default password that you used to do your first login.

Stackato Management Console Welcome

After that, you are ready to deploy apps to Stackato, your own single instance personal Private Paas on EC2!

To learn more about deploying applications to Stackato and navigating the Stackato Web Management console, watch this short YouTube video.

Thinking about setting-up a cluster for to scale for production use? Be sure to contact our sales team to learn how Stackato Enterprise can help your business.

Subscribe to ActiveState Blogs by Email

Share this post:

Category: stackato
About the Author: RSS

Diane Mueller is a Cloud Evangelist at ActiveState. She has been designing & implementing financial applications at Fortune 500 corporations for over 20 years. Diane has been actively involved in development efforts of XBRL Open Standard (http://www.xbrl.org) since 1999.

Comments

3 comments for Getting Started with Private PaaS on Amazon EC2
Permalink

This is definitely a helpful guide. Particularly for those who are not so technically savvy and for those who are beginners. Thank you!

 
Presbyopia is vision problems throughout which the eyes are definitely not qualified to aim evidently on objects that are inside the vicinity of. This ailment might be corrected when utilizing the assistance of this website about contact lenses for presbyopia. As opposed to myopia that will have an effect on folks at any age, presbyopia mostly impacts folks in the age of forty numerous several years and earlier described. Presbyopia predominantly occurs due to within the stiffening of the eye's lens which requires position as a person will grow to be earlier. You are going to have pointed out that the majority people in the age of 40 numerous many years and previously talked about complain of having difficulty in studying, difficulties in viewing in quite very low lights conditions and occasional head aches. That is certainly on account of to lack of ability within the lens to regulate to distinctive designs to assist in perceiving objects which have been in a number of directions. Probably probably the most typically recognized options for presbyopia are studying glasses and bifocal lenses. Nonetheless throughout the modern-day globe, the majority of the men and women select to function with contact lenses for presbyopia apart from examining eyeglasses. There are a few unique strategies by which contact lenses for presbyopia may be made use of to suitable presbyopia. Having reported that each unique of this sort of strategies has its pros and cons for certain sorts of affected person. The optician needs to contemplate some eye confirm ups and exams to assist you recognize which way is very very best fitted to your eyes.

Permalink

Hi,

I'm following your post, which is great by the way, but I'm stuck at the stackato-admin commands. I get a message that says stackato-admin has been replaced by kato. So I'm able to successfully use the kato command to grant admin to my user, but I'm not able to find the equivalent kato command for the "stackato-admin become" command.

Permalink

In Stackato 2.2 you can follow the steps in the Assigning Roles with Kato section of the documentation. See also the kato reference docs for kato setup, kato attach and kato enable

Note: The syntax has changed slightly since Stackato 2.0. If you're using that version, check the kato command line help for the 'setup' command.