Jetty has moved!
Jetty is a project at the Eclipse Foundation.
Jetty Powered:
Contact the core Jetty developers at
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Skip to end of metadata
Go to start of metadata

Jetty on Amazon Elastic Compute Cloud (Amazon EC2)  Tutorial


  • EC2 and S3 Account -  if you do not have EC2 and S3 account. click here
  • Java Runtime Environment - This document assumes that you have successfully setup Java Runtime Environment with JAVA_HOME set and your PATH includes <java_home>\bin
  • SSH Client -  you may use putty and winscp for windows users, and openssh for linux and unix users

 EC2 Environment Setup and Simple Instance Startup

The video tutorial below is all you need to know in starting to use EC2
Flash Version from amazon site: Watch Now
Windows Media format Version from amazon site: Download Now

Creating A Custom Amazon AMI Image

 Here are the steps you need to create your FC6 image. Two notes before
getting started: 1) I am using an FC6 box to run the following commands
on so your luck may vary with older system and 2) Some of these can be
done as a non-root user but you might as well be root for all of them.

If you are in a hurry you may download all of the following steps in a
single script that will generate the custom bootable AMI.

1) Create the image file and initialize the filesystem on it (note that
I'm only making giving myself 1G of space for this install, if you think
you will need more room you should create a larger file by changing the
seek value):

2) Mount the file with a loopback device:

 3) Create base directories and device files:

4) Create the initial fstab [file:

5) Mount the proc under the new root filesystem so yum will work correctly:

6) Create your a yum configuration file:

7) Run yum to install the base group of packages to your root filesystem
(this may take some time but you should see it progress, I have had all
kinds of trouble with yum in the past so if it hangs you may want to
kill it and try again):

8) Clean the yum cache:

9) Move the TLS directory out of the way:

10) Modify the boot script to download your SSH key and stick it in root's directory:

11) Set sshd to allow remote root connections and now hang on DNS problems:

12) Create the networking scripts:

13) Sync and umount your root filesystem:

You have now created your very own bootable AMI. If you want to fiddle
with it from this point you may continue to use the yum command as in
the above examples or you can also remount the filesystem and chroot to
it using a command like this:

now you can install java, svn, cvs, jetty and etc ....

One thing to remember if you use chroot like this is that everything is
local now. You will want to mount the proc filesystem and probably add
entries to /etc/resolve.conf so any hostnames you try to resolve will work.

The next step is to get the AMI to S3 so that it can be booted.

Bundling an AMI

A root file system image needs to be bundled as an AMI in order to be
used with the Amazon EC2 service. The bundling process first compresses
the image to minimize bandwidth usage and storage requirements. The
compressed image is then encrypted and signed to ensure confidentiality
of the data, and authentication against the creator. The encrypted image
is finally split into manageable parts for upload. A manifest file is
created containing a list of the image parts with their checksums. This
chapter provides an overview of the AMI tools that automate this process
and some examples of their use.

The AMI tools are three command-line utilities:

1. ec2-bundle-image bundles an existing AMI
2. ec2-bundle-vol creates an AMI from an existing machine or installed volume
3. ec2-upload-bundle uploads a bundled AMI to S3 storage

Installing the AMI Tools

The AMI tools are packaged as an RPM suitable for running on Fedora Core
3/4 with Ruby 1.8.2 (or greater) installed. On Fedora Core 4 Ruby can be
installed by following the steps below. You will need root privileges to
install the software. You can find the AMI tools RPM from our public S3
downloads bucket.

First install Ruby using the yum package manager.


Install the AMI tools RPM.



Installation Issues


The AMI tools libraries install under /usr/lib/site_ruby. Ruby should
pick up this path automatically, but if you see a load error when
running one of the AMI utilities, it may be because Ruby isn't looking
there. To fix this, add /usr/lib/site_ruby to Ruby's library path, which
is set in the RUBYLIB environment variable.

The manual describing the operation of each utility can be displayed by
invoking it with the --manual parameter. For example:



Invoking a utility with the --help parameter displays a summary and list
of command line parameters. For example:



Using the AMI Tools in Bundling an Image

Once a machine image has been created it must be bundled as an AMI for
use with Amazon EC2, as follows. Use ec2-bundle-image to bundle an image
that you have prepared in a loopback file, as described in the previous

This will create the bundle files:



Uploading a Bundled AMI

The bundled AMI needs to be uploaded for storage in Amazon S3 before it
can be accessed by Amazon EC2. Use ec2-upload-bundle to upload the
bundled AMI that you created as described above. S3 stores data objects
in buckets, which are similar in concept to directories. Buckets must
have globally unique names. The ec2-upload-bundle utility will upload
the bundled AMI to a specified bucket. If the specified bucket does not
exist it will be created. However, if the specified bucket already
exists, and belongs to another user, then ec2-upload-bundle will fail.

And Register as an AMI Bundle 

your bundle is now ready to use

  • No labels
Contact the core Jetty developers at
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery