Getting started

Set up an Amazon Web Services Account

In order to use Java Web Apps in a Box, you'll need an AWS account. Signing up is easy -- you'll need to provide a credit card as Amazon's various services aren't free. Once you've created an account, be sure to sign up for EC2.

Sign into the AWS Management Dashboard

Once you've taken care of all the administrative tasks associated with signing up for AWS and EC2, go ahead and go to the AWS Management Dashboard.

Once there, you should see a link on the left hand side labeled "AMIs" -- if you click it, you'll be presented with a large list of Amazon Machine Images. In the text box in the center of the console, type "ami-aa5abac3" and then press enter.

After pressing enter, you'll be presented with a single list item representing Java Web Apps in a Box's AMI. Go ahead and select the row and then right click -- you should see a new dialog box containing the option to "Launch instance".

Launching Java Web Apps in a Box

Once you click the "Launch instance" option, you'll be presented with another dialog box containing a few options, such as the number of instances (stick with 1 until you're ready for clustered Tomcat); what's more, you'll need to create a Key Pair and Security Group (it's highly recommended you do this to protect your image from malicious people, etc). The Key Pair you create will be what you'll need to SSH to the instance (you'll need to in order to configure MySQL to work with your application, for example).

Once you hit the Launch button on the bottom of the form, you'll have to go through one more page -- rest assured though, that your image has been launched! It'll take a few moments before the actual virtual machine boots up and is ready for use so be patient.

At this point, Java Web Apps in a Box is running! You'll probably want to do two things -- configure Tomcat's Manager application and MySQL.

Using SSH to connect to your instance

In order to ssh to your Java Web Apps in a Box instance, you'll need to locate your key pair; that is, when you create a key pair with Amazon, a .pem file created (for instance, in your home/.ec2 directory). Once you've located the key pair, you can then ssh to your instance like so:

$>ssh -i ./.ec2/tomcat-6.0-ec2.pem root@public_dns_name
Once you've ssh'ed to your instance, you can then further configure Tomcat and MySQL.

Optionally configuring Tomcat

By default, Tomcat's manager application is disabled; thus, if you'd like to enable it, you'll need to update the tomcat-users.xml file located in /usr/local/tomcat-6.0.20/conf. You'll need to either restart Tomcat or re-boot your instance if you do make a change to this file. Note, Tomcat is located in /usr/local/tomcat-6.0.20/.

Optionally configuring MySQL

If you'd like to configure a new database, etc for MySQL, you can access the mysql application by issuing the following command:

mysql -u root --password=root
Note, the password for root is root and thus, you'll want to change it ASAP.