JBoss 3.2.1 Config Notes May 29, 2003 Marty Phelan ============================================================================== A. Install and Config Software ============================================================================== 1. Software used in this installation: a. RedHat Linux 8.0 b. JDK 1.4.1_02 from Sun (may work with JDK 1.4.1_01 also) c. JBoss 3.2.1 with Tomcat 4.1.24 2. IMPORTANT *** After installing JDK set the following variable before using JBoss: export LD_PRELOAD=/usr/java/j2sdk1.4.1_02/jre/lib/i386/server/libjsig.so (assumes location of JDK install to be /usr/java/j2sdk1.4.1_02) 3. This installation sets up a full JBoss app server with all features enabled, including clustering and farming. 4. To start JBoss, use the following commands or create a script file containing: (you may need to modify the path's for your environment) #!/bin/bash export JAVA_HOME=/usr/java/j2sdk1.4.1_02 export LD_PRELOAD=/usr/java/j2sdk1.4.1_02/jre/lib/i386/server/libjsig.so cd /usr/local/jboss-3.2.1_tomcat-4.1.24/bin ./run.sh -c all 5. Download and configure sample applications for testing your JBoss installation. There is a sample application: MapperLibrary which can be used to test your installation. To run the sample application you must do the following: a. create an Oracle user and run the table-create and table-data sql scripts. b. create the LibraryDS connection (step B below) c. create the LibraryTestDomain security domain (step C below) d. configure the Mail service (step F below) e. deploy the mapperlibrary.ear application into /server/all/farm/ ============================================================================== B. Setup Oracle Connection pool(s) ============================================================================== 1. Copy the Oracle driver (e.g. classes12.jar) to /server/all/lib/ 2. Modify /server/all/deploy/transaction-service.xml In "Transactions" section find XidFactory mbean and add/uncomment "Pad" attribute with value of "true" EXAMPLE: true 3. Create a datasource - determine name for datasource(s). EXAMPLE: Datasource name: LibraryDS 4. Modify following example and replace "URL", "User", and "Password". Save file as /server/all/deploy/library-ds.xml IMPORTANT: The name of the file must end in "-ds.xml" to be recognized as a datasource descriptor. ------------------------------------------------------------------------------- Example for Library Datasource using Oracle (based on /docs/examples/jca/oracle-xa-ds.xml) ------------------------------------------------------------------------------- LibraryDS true false oracle.jdbc.xa.client.OracleXADataSource jdbc:oracle:thin:@192.168.5.1:1521:ORCL librarian shelves org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter ------------------------------------------------------------------------------- -- END -- Example for Library Datasource using Oracle ------------------------------------------------------------------------------- ============================================================================== C. Setup "Testing Only" security domain ============================================================================== This security domain is generally used for testing purposes only. It is not optimized for production level performance. 1. Modify /server/all/conf/login-config.xml and add the following section (example): library.users library.roles 2. Create the following files. They can be deployed globally by copying them into the /server/all/conf/ directory, or they can be deployed with your application so they will appear in the classpath (e.g. in a war file in the /WEB-INF/classes directory). NOTE: They cannot be deployed BOTH at the global level and application level. library.users ----------- # -- These are the special users of the Library System librarian=shelves frontdesk=books library.roles ----------- # -- These are the special roles for the Library System librarian=admin,checkout frontdesk=checkout ============================================================================== D. Setup "Database" security domain ============================================================================== This security domain uses a database which contains user and role information. 1. Create the following tables and populate them with data: create table USER_PRINCIPAL ( USER_NAME VARCHAR2(64) PRIMARY KEY not null, PASSWORD VARCHAR2(64) ); create table USER_PRINCIPAL_ROLE ( USER_NAME VARCHAR2(64) not null, USER_ROLE VARCHAR2(32) not null, CONSTRAINT USER_PRINCIPAL_ROLE_PK PRIMARY KEY (USER_NAME,USER_ROLE) ); insert into USER_PRINCIPAL (USER_NAME,PASSWORD) values ('librarian','shelves'); insert into USER_PRINCIPAL (USER_NAME,PASSWORD) values ('frontdesk','books'); insert into USER_PRINCIPAL_ROLE (USER_NAME,USER_ROLE) values ('librarian','admin'); insert into USER_PRINCIPAL_ROLE (USER_NAME,USER_ROLE) values ('librarian','checkout'); insert into USER_PRINCIPAL_ROLE (USER_NAME,USER_ROLE) values ('frontdesk','checkout'); 2. Make sure there is a datasource defined to access these tables. For this example we will use the LibraryDS as defined in section B. 3. Modify /server/all/conf/login-config.xml and add the following section: java:/LibraryDS select password from user_principal where user_name=? select user_role, 'Roles' from user_principal_role where user_name=? ============================================================================== E. Setup "LDAP" security domain -- SECTION NOT COMPLETE -- ============================================================================== This security domain uses an LDAP server which contains user and role information. This example assumes you have an LDAP server up and running with users and roles or groups setup. 3. Modify /server/all/conf/login-config.xml and add the following section: com.sun.jndi.ldap.LdapCtxFactory ldap://pegasus.taursys.com:389/ simple uid= ,ou=People,dc=taursys,dc=com ou=Group,dc=taursys,dc=com member cn true MD5 ============================================================================== F. Configure Mail service ============================================================================== This will configure the mail connector which can be used by applications running in the JBoss container. Modify the /server/all/deploy/mail-service.xml: java:/Mail nobody password ============================================================================== G. Clustering and Farming ============================================================================== The "all" configuration of JBoss 3.2.1 has clustering and farming enabled by default. If your routers/hubs and operating systems are configured to allow multicast traffic, then additional instances of JBoss servers should see each other and cluster. To test multicasting, use the following command: ping -b 224.0.0.1 The systems which have multicasting available should respond: PING 224.0.0.1 (224.0.0.1) from 192.168.5.30 : 56(84) bytes of data. 64 bytes from 192.168.5.30: icmp_seq=1 ttl=64 time=0.084 ms 64 bytes from 192.168.5.50: icmp_seq=1 ttl=64 time=0.993 ms (DUP!) 64 bytes from 192.168.5.30: icmp_seq=2 ttl=64 time=0.071 ms 64 bytes from 192.168.5.50: icmp_seq=2 ttl=64 time=0.505 ms (DUP!) ... (you should see yourself in this list as well)