User guide

Chapter 4. Launching a standalone JBoss Enterprise Web
Server instance
In this example a sample web application is deployed on Apache Tomcat 6 server. An Apache HT T PD
server is used as a reverse proxy.
4.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 ports 22 and 80.
4.2. Launcher 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.
# deploy the hello.war sample application to the Apache Tomcat 6 server
which is part of the JBoss Enterprise Web Server offering
cp /usr/share/java/jboss-ec2-ews-samples/hello-1.0.war
/usr/share/tom cat6/webapps/hello.war
# Configure HTTPd to act as a proxy to the Apache Tomcat 6 server
cat >> /etc/httpd/conf.d/proxy_ajp.conf <<"EOF"
<Location /hello>
ProxyPass http://localhost:8080/hello
ProxyPassReverse http://localhost:8080/hello
</Location>
ProxyPreserveHost On
EOF
# Start the Apache Tomcat 6 server
service tomcat6 start
# Instruct SELinux to allow HTTPd to serve as a proxy relay
setsebool -P httpd_can_network_relay 1
# Start the HTTPd server
service httpd start
4.3. Test JBoss Enterprise Web Server
Procedure 4 .1. T est JBoss EWS
1. In the instance's details pane, note the instance's "Public DNS".
2. In a browser, navigate to http://<public-DNS>/hello
3. Confirm that the text "Hello World!" appears, otherwise refer to Appendix B, Troubleshooting.
JBoss Enterprise Application Platform 5 Getting Started on Amazon EC2
12