User guide

Chapter 5. Launching a standalone JBoss Enterprise
Application Platform instance
In this example a sample web application is deployed to a standalone JBoss Enterprise Application
Platform instance.
For an example using clustering and Amazon's Relational Database Service (RDS), refer to Chapter 6,
Launching clustered JBoss Enterprise Application Platform instances.
5.1. Prerequisites
Suitable Red Hat AMI identified in Chapter 3, Identify a suitable Red Hat AMI;
A pre-configured Security Group which allows incoming requests on at least ports 22 and 8080.
5.2. Launch instance
Launch the Red Hat AMI identified in Chapter 3, Identify a suitable Red Hat AMI, adding the following
lines to the "User Data:" field, inserting your JBoss admin password instead of the placeholder.
JBOSSAS_ADMIN_PASSWORD=<your password for opening admin console>
JBOSS_IP=0.0.0.0 #listen on all IPs and interfaces
cat> $ USER_SCRIPT << "EOF"
## Deploy your application from an Internet URL
# wget https://<your_secure_storage_hostname>/<path>/<app_name>.war -O
/var/lib/jbossas/server/$JBOSSCONF/deploy/
## deploy sample application from the local filesystem
cp /usr/share/java/jboss-ec2-eap-sam ples/hello-1.0.war
/var/lib/jbossas/server/$JBOSSCONF/deploy/hello.war
EOF
This example below deploys a sample application already on the Red Hat AMI. T o deploy your own
application instead, comment the line which deploys the sample application and uncomment the line
which deploys your application, modifying the source URL as required.
If this is to be a production instance, add the following command under USER_SCRIPT in the "User
Data:" field, to ensure that security updates are applied on boot:
Also ensure that yum -y update is run regularly to apply security fixes and enhancements.
yum -y update
Important
There are a number of parameters which can be used in the User Data field to customize the
configuration and deployment of JBoss Enterprise Application Platform. Refer to Appendix A, User
Script Parameters for details.
5.3. Test JBoss Enterprise Application Server
JBoss Enterprise Application Platform 5 Getting Started on Amazon EC2
14