DEPLOYING WDK APPLICATIONS ON JBOSS APPLICATION SERVER AND APACHE WEB SERVER VIA MOD_JK PROXY

Similar documents
Configuration Guide Configuring Apache HTTP Server as a Reverse Proxy Server for SAS Web Applications Deployed on JBoss

Red Hat JBoss Web Server 2

JBoss Enterprise Application Platform 5

Red Hat JBoss Web Server 2.1

Red Hat JBoss Web Server 3

Red Hat JBoss Core Services

CA Open Space. Implementation Guide. Release

CodeCharge Studio Java Deployment Guide Table of contents

COPYRIGHTED MATERIAL

EMC Documentum PDF Annotation Services

Tomcat Load Balancing for Progress Application Server for OpenEdge

EMC Documentum Web Services for Records Manager and Retention Policy Services

Implementing load balancing for PAS for OpenEdge based on Tomcat Load Balancing

Kewill Customs Installations Guide

i) isapi_redirect dll (downloaded from )

For Version 10.3 or Later

PDF Annotation Services Installation Guide

Kewill Customs Installations Guide

Se#ng up your mul.- engine environment Apache, Railo and ColdFusion

MODEM on HP-UX. Guy Van Sanden.

JBoss to Geronimo - EJB-Session Beans Migration

Technical white paper Asset Manager 9.5x Deployment Sizing Guide

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

Administering the JBoss 5.x Application Server

UIMA Simple Server User Guide

EuroGeoSource. EU Information and Policy Support System for Sustainable Supply of Europe with Energy and Mineral Resources WP 5

CHAPTER 6. Organizing Your Development Project. All right, guys! It s time to clean up this town!

JBoss to Geronimo - EJB-MDB Migration

SUN Enterprise Development with iplanet Application Server

Inside WebSphere Application Server

JBoss ESB 4.5 GA. Getting Started With JBoss ESB JBESB GS 2/11/09 JBESB-GS-2/11/09

EMC Documentum Process Engine

JBoss SOAP Web Services User Guide. Version: M5

servlets and Java JSP murach s (Chapter 2) TRAINING & REFERENCE Mike Murach & Associates Andrea Steelman Joel Murach

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

Live Data Connection to SAP Universes

Installing, Migrating, and Uninstalling HCM Dashboard

Life Without NetBeans

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

How to use J2EE default server

Red Hat JBoss Web Server 1.0

Web Application Architecture (based J2EE 1.4 Tutorial)

Web Collaborative Reviewer Installation Guide. Small Business Edition

EMC Documentum Composer

Red Hat JBoss Web Server 3.1

xpression Documentum Edition Installation Guide Version 3.5

Installing and Configuring the JBOSS Application Server for IBM Cognos 8

SSO Plugin. Integrating Business Objects with BMC ITSM and HP Service Manager. J System Solutions. Version 5.

Course: JBoss Training: JBoss AS 7 and JBoss EAP 6 Administration and Clustering Training

EMC Documentum Process Builder

Interstage Business Process Manager Analytics V12.1. Installation Guide. Solaris

Kewill Customs Installations Guide

EMC Documentum Connector for Microsoft SharePoint Farm Solution

Tutorial: Developing a Simple Hello World Portlet

JBoss WS User Guide. Version: GA

JBoss ESB 4.6. Getting Started With JBoss ESB JBESB-GS-7/17/09

J2EE Packaging and Deployment

EMC Documentum External Viewing Services for SAP

AutoVue Integration SDK & Sample Integration for Filesys DMS

Novell Access Manager

JBOSS AS 7 AND JBOSS EAP 6 ADMINISTRATION AND CLUSTERING (4 Days)

EMC Documentum Quality and Manufacturing

Setup of HELIO Components Definition of Required Capabilities V0.8

BlueDragon TM 3.0 Deploying CFML on J2EE Servers

JBoss ESB GA. Getting Started With JBoss ESB JBESB-GS-10/31/07

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p.

VirtualViewer Documentum D2 Integration Deployment Guide

EMC ApplicationXtender SPI (for SharePoint Integration)

KonaKart Portlet Installation for Liferay. 2 nd January DS Data Systems (UK) Ltd., 9 Little Meadow Loughton, Milton Keynes Bucks MK5 8EH UK

Topics Augmenting Application.cfm with Filters. What a filter can do. What s a filter? What s it got to do with. Isn t it a java thing?

An Oracle White Paper May Example Web Listener Deployment for Oracle Application Express

Novell Integration Manager

Deploying Intellicus Portal on IBM WebSphere. Version: 7.3

Artix for J2EE. Version 4.2, March 2007

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

Kewill Customs Installations Guide

VMware Identity Manager Connector Installation and Configuration (Legacy Mode)

Oracle 10g: Build J2EE Applications

Abstract. Avaya Solution & Interoperability Test Lab

PKI Cert Creation via Good Control: Reference Implementation

Unraveling the Mysteries of J2EE Web Application Communications

Red Hat JBoss Web Server 3

EMC Documentum Federated Search Services

Galigeo for Cognos HTML5 Installation Guide - G18.0

WAS: WebSphere Appl Server Admin Rel 6

Securent Entitlement Management Solution. v 3.1 GA. JACC Agent for WebSphere. September Part No. 31GA-JACCAGENTWEBSPHERE-1

MISP2 installation and configuration guide. Version 2.12

Classloader J2EE rakendusserveris (Bea Weblogic Server, IBM WebSphere)

Vendor: IBM. Exam Code: A Exam Name: Assessment: IBM WebSphere Appl Server ND V8.0, Core Admin. Version: Demo

Building the Enterprise

web.xml Deployment Descriptor Elements

Enterprise JavaBeans. Layer:01. Overview

Edition 0.1. real scenarios for managing EAP instances. Last Updated:

PowerSchool Student Information System

Supplement IV.E: Tutorial for Tomcat For Introduction to Java Programming By Y. Daniel Liang

NetBeans IDE Field Guide

Genesys Administrator Extension Migration Guide. Prerequisites

EMC Documentum Composer

White Paper. Fabasoft Folio Portlet. Fabasoft Folio 2017 R1 Update Rollup 1

CA Identity Manager. Installation Guide (JBoss) r12.5

Transcription:

White Paper DEPLOYING WDK APPLICATIONS ON JBOSS APPLICATION SERVER AND APACHE WEB SERVER VIA MOD_JK PROXY Abstract This white paper explains how to deploy WDK based applications in JBOSS application server. This guide also explains about how to install and configure apache http web server via mod_jk proxy for JBOSS application server. September 2012

Copyright 2012 EMC Corporation. All Rights Reserved. EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice. The information in this publication is provided as is. EMC Corporation makes no representations or warranties of any kind with respect to the information in this publication, and specifically disclaims implied warranties of merchantability or fitness for a particular purpose. Use, copying, and distribution of any EMC software described in this publication requires an applicable software license. For the most up-to-date listing of EMC product names, see EMC Corporation Trademarks on EMC.com. Part Number H11113 2

Table of Contents Executive Summary... 4 Purpose... 4 Audience... 4 Introduction... 4 Prerequisites... 5 Installing JBOSS application server... 6 Creating WDK application as an Enterprise Archive (EAR) file... 6 application.xml:... 8 dfc.properties... 8 Deploy the EAR file to the application server and test the enterprise archive application.... 8 Start the Jboss application server... 8 Test the application... 9 Download Apache2 and Installing an Apache 2..x web server... 10 Download modjk 1.2.x (At least 1.2.27 suggested)... 10 Change the main Apache config to include modjk config... 10 Create the modjk config... 11 Configure the modjk workers (which JBoss/Tomcat nodes Apache uses)... 13 Configure the Apache URIs served by modjk (the applications served by JBoss/Tomcat) - Create the URI to worker map file... 15 Restart Apache... 16 Configure JBOSS/Tomcat (Give each JBoss/Tomcat a jvmroute for session stickness)16 Activate the JvmRouteValve in JBoss (not needed with Tomcat Standalone)... 17 Restart JBoss... 18 Test it... 20 Requestdumpervalve... 22 References... 23 Conclusion... 23 3

Executive Summary This white paper explains the ideal way to successfully deploy the wdk based applications in JBOSS application server and explains about how to install and configure the apache http web server via mod_jk proxy. In addition, this whitepaper also explains the configurations to deploy wdk application as an enterprise archive (ear) in JBOSS application server. As part of the effort to improve and enhance the performance and capabilities of its product line, EMC, from time to time releases revisions of its hardware and software. Therefore, some functions described in this guide may not be supported by all revisions of the software or hardware currently in use. For the most up-to-date information on product features, refer to your product Release Notes document. If a product does not function properly or does not function as described in this document, please contact your EMC representative. Note: We vouch that the content in this document is accurate at the time of publication. However, as information is added, new versions of this document may be released to the EMC online support website. Check the website to ensure that you are using the latest version of this document. Purpose This document explains the process of deploying the wdk application as an enterprise archive application in a JBOSS application server and explains about configuring apache webserver via mod_jk proxy to redirect requests to JBOSS application server. Audience The audience for this white paper comprises personnel responsible for the configuration and administration of the JBOSS application server production environment with regard to WDK-based web applications. This document is intended for internal EMC personnel, partners, and customers. Introduction This guide discusses how to create and deploy WDK based enterprise archive application on JBOSS application server, which is configured for accessing requests from apache web server configured via mod_jk proxy. The process of installing and configuring the JBOSS Application server, Apache Web server configured via mod_jk proxy and deploying the wdk application as an enterprise archive in JBOSS application server involves the following steps: 4

Installing the JBOSS application server Create EAR file from WDK application war file Deploy the EAR file to the application server and test the enterprise archive application. Download Apache2 and Installing an Apache 2..x web server Download modjk 1.2.x (At least 1.2.27 suggested) Change the main Apache config to include modjk config Create the modjk config Configure the modjk workers (which JBoss/Tomcat nodes Apache uses) Configure the Apache URIs served by modjk (the applications served by JBoss/Tomcat) Restart Apache Configure JBOSS/Tomcat (Give each JBoss/Tomcat a jvmroute for session stickness) Restart JBoss Test it Prerequisites Below are the environment details where this setup was configured and tested. This is one of the working scenario, not requirement of OS. Application server machines: Windows XP OS 32 bit machine Install the desired Application Server version (jboss-4.2.3.ga) and WDK/Webtop based application will be deployed in the respective Application Server. Apache Web Server machines: Windows XP OS 32 bit machine Install the desired Apache Web server version (Apache Http 2.0.64) and configure it to work with JBOSS Application server. 5

Most httpd-2.2.x actual distributions (x>=6) have a decent AJP proxying and don't require to compile an external module. Mod_jk load Balancer/proxy machine: Windows XP OS 32 bit machine Install the desired Apache Webserver (Apache Http 2.0.64) for mod_jk proxy. Configure mod_jk (1.2.37) as a proxy for Apache webserver machine NOTE: Don't use any release prior to mod_jk 1.2.15. Earlier releases are fairly buggy. WDK Application Webtop (version D 6.7) as the wdk application, have used to deploy in the JBOSS application server. Installing JBOSS application server Download the jboss application server as a zip file from the below mentioned url and extract to the desired location in your machine. http://www.jboss.org/jbossas/downloads/ Upon completion of the jboss extraction, you can notice a folder called <jbosshome>/server/default/deploy to deploy web applications. You can deploy or copy wdk based application as a Web archive (war) file or Enterprise Archive (ear) file to this location. Note: <jboss-home> is the location where JBOSS application server was installed/deployed. Creating WDK application as an Enterprise Archive (EAR) file The WAR file is a convenient way to bundle up all pieces of a web application. All servlet containers know how to deploy a WAR file they expand the bundle, look for the WEB-INF directory, and read the web.xml found there for further deployment instructions. The EAR file provides the same type of functionality for a full-fledged J2EE application. JBoss expands the EAR, finds the required deployment descriptors, and proceeds from there. 6

An EAR is like a carton of eggs it keeps everything organized. While the carton doesn t add any direct value to your omelet, it makes getting the eggs home from the store so easy that you wouldn t think about transporting eggs any other way. Each egg in your EAR carton is a specific piece of the J2EE puzzle. These eggs (or JARs) come in three basic varieties called modules : Web module A WAR file containing presentation tier components EJB module An EJB JAR file containing the middle-tier components (EJBs, MDBs, etc.) Java module A regular JAR file containing classes and libraries that are shared across the entire application. An application client JAR and a common JAR are two examples of Java modules. Below is the sample ear (webtopear from wdk application war file) application structure. 7

application.xml: We need to create application.xml file under META-INF folder of ear application. Below is the sample snippet of xml file. <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> <display-name>webtopear</display-name> <module> <web> <web-uri>webtop66.war</web-uri> <context-root>/webtopear</context-root> </web> </module> </application> Note: Here, /webtopear is the context path of the application. We can specify the context path according to business requirement. dfc.properties We need to configure proper repository values in the dfc.properties file. The dfc.properties file can be found in the webtop.ear\webtop.war\web-inf\classes location. Deploy the EAR file to the application server and test the enterprise archive application. After creating the webtopear.ear file with the above folder structure, we need to deploy or copy the webtop.ear file in the <jboss-home>\server\default\deploy location. Start the Jboss application server 1. Go to the command prompt and specify the location <jboss-home>\bin. 2. To start the server, type run.bat and enter. This command will start and run the jboss application server and deploy the webtop.ear in JBOSS application server. 8

3. Notice the webtopear.ear is deployed under jboss application server. Test the application 4. Access the application url in your favorite browser http://<host-name>:<port-number>/webtopear 5. Notice the wdk based (webtop) application (As an Enterprise Archive) is deployed and running successfully in the browser. 9

Download Apache2 and Installing an Apache 2..x web server Get the latest Apache2 package from Apache.org and install it. We require no special configuration, just use the default settings. In the following steps, APACHE_HOME will represent the Apache install directory, for example C:\Program Files\Apache Group\Apache2 Download modjk 1.2.x (At least 1.2.27 suggested) Download the latest package available from Tomcats's 'Download Tomcat connector section' page. Always download the latest stable release if possible. Rename the lib mod_jk.so and drop it in APACHE_HOME/modules directory. NOTE: Don't use any release prior to mod_jk 1.2.15. Earlier releases are fairly buggy. Change the main Apache config to include modjk config Add this line at the very bottom in APACHE_HOME/conf/httpd.conf : 10

# Include mod_jk configuration file Include conf/mod-jk.conf Create the modjk config # Load mod_jk module # Specify the filename of the mod_jk lib LoadModule jk_module modules/mod_jk.so # Where to find workers.properties JkWorkersFile conf/workers.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE # Notes: # 1) Changed from +ForwardURICompat. # 2) For mod_rewrite compatibility, use +ForwardURIProxy (default since 1.2.24) # See http://tomcat.apache.org/security-jk.html JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # Mount your applications 11

JkMount /webtopear/* loadbalancer # Let Apache serve the images JkUnMount /webtopear/images/* loadbalancer # You can use external file for mount points. # It will be checked for updates each 60 seconds. # The format of the file is: /url=worker # /examples/*=loadbalancer JkMountFile conf/uriworkermap.properties # Add shared memory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly # Note: Replaced JkShmFile logs/jk.shm due to SELinux issues. Refer to # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225452 JkShmFile run/jk.shm # Add jkstatus for managing runtime data <Location /jkstatus/> JkMount status Order deny,allow Deny from all Allow from 127.0.0.1 </Location> <Location /jkstatus/> JkMount status Order deny,allow Deny from all Allow from <host-name> 12

</Location> <Location /webtopear/> JkMount status Order deny,allow Deny from all Allow from <host-name> </Location> Now, mod_jk is ready to forward requests to JBoss instances. We need now to setup the workers Note: As of now, mod_jk 1.2.6+ you need to include "JkMountCopy all" in globals if you intend to specify global JkMount's or JkMountFile's instead of per VirtualHost. If you do not want to copy the same JkMount/JkMountFile for each VirtualHost, you can specify "JkMountCopy On" inside the VirtualHost directive. Configure the modjk workers (which JBoss/Tomcat nodes Apache uses) Under APACHE_HOME/conf, create workers.properties and populate it as follows # Define list of workers that will be used for mapping requests # The configuration directives are valid for the mod_jk version 1.2.18 and later # worker.list=loadbalancer,status # Define Node1 # modify the host as your host IP or DNS name. worker.node1.port=8009 worker.node1.host=localhost worker.node1.type=ajp13 worker.node1.lbfactor=1 worker.node1.cachesize=10 13

worker.node1.prepost_timeout=10000 #Not required if using ping_mode=a worker.node1.connect_timeout=10000 #Not required if using ping_mode=a worker.node1.ping_mode=a #As of mod_jk 1.2.27 # worker.node1.connection_pool_size=10 (1) # Load-balancing behaviour worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1 worker.loadbalancer.sticky_session=1 # Status worker for managing load balancer worker.status.type=status (1) You should only set the connection_pool_size if the number of allowed connection to the Httpd is higher than maxthreads in server.xml (2) If you specify worker.loadbalancer.sticky_session=off, each request will be load balanced between node1 and node2. But when a user opens a Session on one 14

server, it is a good idea to always forward this user's requests to the same server. Otherwise the user's session data would need to be synchronized between both servers. This is called a "sticky session", as the client is always using the same server he reached on his first request. Session stickiness is enabled by default. Side Note: a non-loadbalanced setup with a single node required the "worker.list=node1" entry before mod_jk would function correctly. Configure the Apache URIs served by modjk (the applications served by JBoss/Tomcat) - Create the URI to worker map file Create a uriworkermap.properties file in the APACHE_HOME/conf directory. This file should contain the URL mappings you want Apache to forward to Tomcat. The format of the file is /url=worker_name. To get things started, paste this example into the file you created: # Simple worker configuration file # # Mount the Servlet context to the ajp13 worker /jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancer /myapp/*=loadbalancer!/myapp/images/*=loadbalancer /webtopear=loadbalancer /webtopear/*=loadbalancer!/webtopear/images/*=loadbalancer 15

This will configure mod_jk to forward requests for the /jmx-console, /web-console and /webtopear contexts to JBoss Web. The '!' at the beginning of the last line results in the URLs for the images dir in the webtopear context not being forwarded. Instead httpd will handle them directly (which means they must be available on the httpd server). Restart Apache We need to restart the apache http web server to consider the mod_jk as a proxy to route the requests to JBOSS application server. Configure JBOSS/Tomcat (Give each JBoss/Tomcat a jvmroute for session stickness) To complete the configuration, we also need to name each node to match the names specified in workers.properties. To do this, edit the server.xml file. Where server.xml is located depends on the version of JBoss AS: In JBoss 5, it's $JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml 16

In JBoss 4.2.x and EAP 4.x, it's $JBOSS_HOME/server/default/deploy/jbossweb.deployer/server.xml In earlier releases it's $JBOSS_HOME/server/default/deploy/jbosswebtomcatXX.sar/server.xml where XX is 40, 50, 55 etc depending on the Tomcat version embedded in the AS. (In the examples above, replace /default/ with the name of the AS configuration you are running.) Locate the <Engine/.> element and add an attribute jvmroute: <Engine name="jboss.web" defaulthost="localhost" jvmroute="node1"> </Engine> Note: The jvmroute attribute value must match the name specified in workers.properties. In the server.xml file, make sure that the AJP 1.3 Connector is uncommented, e.g.: <!-- A AJP 1.3 Connector on port 8009 --> <Connector port="8009" address="${jboss.bind.address}" emptysessionpath="true" enablelookups="false" redirectport="8443" protocol="ajp/1.3" connectiontimeout="600000" maxthreads="200"/> If you are only accepting requests via mod_jk, you can comment out the regular HTTP Connector; Tomcat then won't listen on port 8080. Activate the JvmRouteValve in JBoss (not needed with Tomcat Standalone) Finally, we need to tell JBoss to add a special valve that detects when failover of a session from a distributable webapp has occurred. This JvmRouteValve ensures a 17

new session cookie is emitted that includes the jvmroute of the server that is now handling the session. This configuration step is only needed with JBoss 4.2.x and earlier; beginning with JBoss AS 5 the application server uses the existence of a jvmroute configuration in server.xml as an indication that it should add the JvmRouteValve. To do this, edit the jboss-service.xml file for the JBoss Web service. Where this is located depends on the version of JBoss AS: In JBoss 5, this step isn't needed. In JBoss 4.2.x and EAP 4.x, it's $JBOSS_HOME/server/all/deploy/jbossweb.deployer/META-INF/jboss-service.xml In earlier releases it's $JBOSS_HOME/server/all/deploy/jbosswebtomcatXX.sar/META-INF/jboss-service.xml where XX is 40, 50, 55 etc depending on the Tomcat version embedded in the AS. Locate the <attribute> element with a name of UseJK, and set its value to "true": <attribute name="usejk">true</attribute> Restart JBoss We need to restart the JBOSS server to accept requests from Apace web server via mod_jk proxy to JBOSS application server. Notice that wdk based enterprise archive application deployed successfully in JBOSS application server via JBOSS Apache Web Server 18

Deploying webtopear file in JBOSS application server 19

Notice that JBOSS application server can accept requests through JBOSS apache web server. Test it You can test the application by running the application url in the favorite browser. http://<host-name>/webtopear 20

21

Requestdumpervalve RequestDumperValve attribute is used to dump the requests and its response url s and associate header information in the application server log file. To enable this request information, we need to uncomment the below tag from <jboss-home>/server/default/deploy/jboss-web.deployer\server.xml file <Valve classname="org.apache.catalina.valves.requestdumpervalve" /> This Valve "logs interesting contents from the specified Request (before processing) and the corresponding Response (after processing). It is especially useful in debugging problems related to headers and cookies." Below is the sample screenshot which shows the request information. 22

References http://tomcat.apache.org/connectors-doc/reference/apache.html http://tomcat.apache.org/connectors-doc/reference/workers.html https://community.jboss.org/wiki/usingmodjk12withjboss Conclusion This white paper explains how to deploy wdk based application as an enterprise archive application in JBOSS application Server. This white paper also explains on how to install and configure Apache HTTP web server via mod_jk proxy. 23