![]() |
|||||
|
openCRX Installation Guide for JBoss 3Version 1.4.0www.opencrx.orgThe contents of this file are subject to a BSD license (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License here
Chapter 1. About this BookopenCRX is the leading open source CRM tool. openCRX is based on the openMDX [02] application framework, an open source application framework based on the OMG's model driven architecture (MDA) standards. This guarantees maximum openness, standards compliance and a state-of-the-art component-based architecture. Who this book is forThis book describes the installation of openCRX for JBoss. The intended audience are openCRX and application server system administrators. What do you need to understand this bookThis book describes the installation of openCRX for JBoss. The book assumes that you are familiar with JBoss deployment concepts and administration. Chapter 2. PrerequisitesAs a first step select the openCRX version you want to install. Based on the published version compatibility information you can determine the appropriate versions of openMDX, JBoss, and Java JDK/JRE.
Chapter 3. Installing openCRX for JBossIn a first step you must install JBoss by extracting the delivered JBoss distribution to your program directory, e.g. d:/pgm/jboss-3.2.5.
Next you must deploy openCRX to JBoss. You do this by copying several files to the JBoss deploy directory:
Next you must set a few Java VM options which are required for the openMDX application framework. Add the following lines to d:/pgm/jboss-3.2.5/bin/run.bat after the lines indicated below. Also uncomment the line set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m. This gives more memory to the Java VM. Example 3-2. Java VM options required for openMDX. rem Sun JVM memory allocation pool parameters. Uncomment and modify as appropriate.
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m
rem Setup openMDX-specific properties
set JAVA_OPTS=%JAVA_OPTS% -Dorg.openmdx.compatibility.base.application.j2ee.domain=apps
set JAVA_OPTS=%JAVA_OPTS% -Dorg.openmdx.compatibility.base.application.j2ee.server=server1
set JAVA_OPTS=%JAVA_OPTS% -Djava.protocol.handler.pkgs=org.openmdx.kernel.url.protocol
set JAVA_OPTS=%JAVA_OPTS% -Dorg.openmdx.log.config.filename=D:\pgm\jboss-3.2.5\server\default\server.log.properties
Chapter 4. Configuring SecurityAs a final step you must activate security for the openCRX application. You can either configure the file-based UsersRolesLoginModule or the database-based DatabaseServerLoginModule. Configuring UsersRolesLoginModuleActivate JAAS based authentication by adding the following TWO configuration entries for the standard and the root servlet to d:/pgm/jboss-3.2.5/server/default/conf/login_config.xml (login-config.xml on Unix platforms!). Add the following security policy for the root servlet: Example 4-1. JBoss login_config.xml for JAAS login configuration for the root servlet. <application-policy name = "opencrx-core-CRX-Root">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
<module-option name="usersProperties">openCRX.users.properties</module-option>
<module-option name="rolesProperties">openCRX.roles.properties</module-option>
</login-module>
</authentication>
</application-policy>Add the following security policy for the standard servlet: Example 4-2. JBoss login_config.xml for JAAS login configuration for the standard servlet. <application-policy name = "opencrx-core-CRX">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
<module-option name="usersProperties">openCRX.users.properties</module-option>
<module-option name="rolesProperties">openCRX.roles.properties</module-option>
</login-module>
</authentication>
</application-policy>Then create the files openCRX.users.properties and openCRX.roles.properties in directory d:/pgm/jboss-3.2.5/server/default/conf: Example 4-3. openCRX.users.properties with user=password syntax. admin-Root=rootSecret admin-Standard=adminSecret guest=guest Example 4-4. openCRX.roles.properties with user.Roles=role1,role2 syntax. admin-Root.Roles=OpenCrxRoot admin-Standard.Roles=OpenCrxAdministrator guest.Roles=OpenCrxUser Add additional users of your choice to the files. Configuring DatabaseServerLoginModuleopenCRX stores security information in the database tables security_Policy, security_Principal, security_Credential, security_Subject and security_Role. JBoss allows to access these tables by configuring a database login module. This way users can be managed in openCRX and are immediately available as JBoss logins.
Activate JAAS based authentication by adding the following configuration entries for the root servlet to d:/pgm/jboss-3.2.5/server/default/conf/login_config.xml (login-config.xml on Unix platforms!). Example 4-5. JBoss login_config.xml for JAAS login configuration for the root servlet. <application-policy name = "opencrx-core-CRX-Root">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
<module-option name="usersProperties">openCRX.users.properties</module-option>
<module-option name="rolesProperties">openCRX.roles.properties</module-option>
</login-module>
</authentication>
</application-policy>Then create the files openCRX.users.properties and openCRX.roles.properties in directory d:/pgm/jboss-3.2.5/server/default/conf: Example 4-7. openCRX.roles.properties with user.Roles=role1,role2 syntax. admin-Root.Roles=OpenCrxRoot Add the following security policy for the standard servlet for NON-PostgreSQL databases:
Example 4-8. JBoss login_config.xml for JAAS login configuration for the standard servlet for NON-PostgreSQL databases. <application-policy name="opencrx-core-CRX">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name="dsJndiName">java:/jdbc_opencrx_CRX</module-option>
<module-option name="principalsQuery">SELECT c.passwd FROM security_Principal p, security_Credential c WHERE
(p.object_rid IN (SELECT object_rid FROM security_REF WHERE c$0='org:openmdx:security:realm1' AND c$1='provider' AND
c$2='CRX' AND c$3='segment' AND c$4='Root' AND c$5='realm' AND c$6='Default' AND c$7='principal' AND n=8)) AND
(p.p$$credential__rid = c.object_rid) AND (p.p$$credential__oid = c.object_oid) AND (p.object_idx = 0) AND
(p.object_oid = ?)</module-option>
<module-option name="rolesQuery">SELECT pg.p$$granted_role__oid, 'Roles' FROM security_Principal pg,
security_Principal p WHERE (pg.object_rid = p.p$$is_member_of__rid) AND (pg.object_oid = p.p$$is_member_of__oid) AND
(p.object_rid IN (SELECT object_rid FROM security_REF WHERE c$0='org:openmdx:security:realm1' AND c$1='provider' AND
c$2='CRX' AND c$3='segment' AND c$4='Root' AND c$5='realm' AND c$6='Default' AND c$7='principal' AND n=8)) AND
(p.object_oid = ?)</module-option>
<module-option name="ignorePasswordCase">true</module-option>
<module-option name="hashCharset">UTF-8</module-option>
<module-option name="hashEncoding">base64</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
</login-module>
</authentication>
</application-policy>
Add the following security policy for the standard servlet for PostgreSQL databases: Example 4-9. JBoss login_config.xml for JAAS login configuration for the standard servlet for PostgreSQL databases. <application-policy name="opencrx-core-CRX">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name="dsJndiName">java:/jdbc_opencrx_CRX</module-option>
<module-option name="principalsQuery">SELECT c.passwd FROM security_Principal p, security_Credential c
WHERE (p.object_rid IN (SELECT object_rid FROM security_REF WHERE "c$0"='org:openmdx:security:realm1' AND
"c$1"='provider' AND "c$2"='CRX' AND "c$3"='segment' AND "c$4"='Root' AND "c$5"='realm' AND "c$6"='Default' AND
"c$7"='principal' AND n=8)) AND (p."p$$credential__rid" = c.object_rid) AND (p."p$$credential__oid" = c.object_oid) AND
(p.object_idx = 0) AND (p.object_oid = ?)</module-option>
<module-option name="rolesQuery">SELECT pg."p$$granted_role__oid", 'Roles' FROM security_Principal pg,
security_Principal p WHERE (pg.object_rid = p."p$$is_member_of__rid") AND (pg.object_oid = p."p$$is_member_of__oid") AND
(p.object_rid IN (SELECT object_rid FROM security_REF WHERE "c$0"='org:openmdx:security:realm1' AND
"c$1"='provider' AND "c$2"='CRX' AND "c$3"='segment' AND "c$4"='Root' AND "c$5"='realm' AND "c$6"='Default' AND
"c$7"='principal' AND n=8)) AND (p.object_oid = ?)</module-option>
<module-option name="ignorePasswordCase">true</module-option>
<module-option name="hashCharset">UTF-8</module-option>
<module-option name="hashEncoding">base64</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
</login-module>
</authentication>
</application-policy>Chapter 5. Starting JBossYou are now ready to start JBoss. Open a command shell and start d:/pgm/jboss-3.2.5/bin/run.bat. You should verify the following lines in the console output: Verify whether the start options are as configured in run.bat described earlier: Example 5-1. JBoss start options. =============================================================================== . JBoss Bootstrap Environment . JBOSS_HOME: D:\pgm\jboss-3.2.5\bin\\.. . JAVA: d:\pgm\jdk1.3.1\bin\java . JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m -Duser.region=DE -Duser.language=de -Dorg.openmdx.compatibility.base.application.j2ee.domain=apps -Dorg.openmdx.compatibility.base.application.j2ee.server=server1 -Djava.protocol.handler.pkgs=org.openmdx.kernel.url.protocol -Dorg.openmdx.log.config.filename=D:\pgm\jboss-3.2.5\server\default\server.log.properties . CLASSPATH: d:\pgm\jdk1.3.1\lib\tools.jar;D:\pgm\jboss-3.2.5\bin\\run.jar . =============================================================================== Example 5-2. Deployment of database datasource. [jdbc_opencrx_CRX-MAXDB] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=jdbc_opencrx_CRX-MAXDB to JNDI name 'java:/jdbc_opencrx_CRX-MAXDB' Example 5-3. Deployment of opencrx-core-CRX-App.ear. [EARDeployer] Init J2EE application: file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-App.ear [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null [EjbModule] Deploying opencrx_core_CRX_security_mandatory [EjbModule] Deploying opencrx_core_CRX_ui_never [EjbModule] Deploying opencrx_core_CRX_kernel_mandatory [EjbModule] Deploying opencrx_core_CRX_gateway_mandatory [EjbModule] Deploying opencrx_core_CRX_gateway_noOrNew [EJBDeployer] Deployed: file:/D:/pgm/jboss-3.2.5/server/default/tmp/ deploy/tmp18869opencrx-core-CRX-App.ear-contents/security.jar [EJBDeployer] Deployed: file:/D:/pgm/jboss-3.2.5/server/default/tmp/ deploy/tmp18869opencrx-core-CRX-App.ear-contents/ui.jar [EJBDeployer] Deployed: file:/D:/pgm/jboss-3.2.5/server/default/tmp/ deploy/tmp18869opencrx-core-CRX-App.ear-contents/kernel.jar [EJBDeployer] Deployed: file:/D:/pgm/jboss-3.2.5/server/default/tmp/ deploy/tmp18869opencrx-core-CRX-App.ear-contents/gateway.jar [TomcatDeployer] deploy, ctxPath=/opencrx-core-CRX/soap, warUrl= file:/D:/pgm/jboss-3.2.5/server/default/tmp/deploy/tmp18869opencrx-core-CRX-App.ear-contents/soapservlet.war/ [EARDeployer] Started J2EE application: file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-App.ear Example 5-4. Deployment of opencrx-core-CRX-web.ear and opencrx-core-CRX-Root-web.ear. [EARDeployer] Init J2EE application: file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-Root-web.ear/ [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null [TomcatDeployer] deploy, ctxPath=/opencrx-core-CRX-Root, warUrl= file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-Root-web.ear/opencrx-core-CRX-Root.war/ [EARDeployer] Started J2EE application: file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-Root-web.ear/ [EARDeployer] Init J2EE application: file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-web.ear/ [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null [TomcatDeployer] deploy, ctxPath=/opencrx-core-CRX, warUrl= file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-web.ear/opencrx-core-CRX.war/ [EARDeployer] Started J2EE application: file:/D:/pgm/jboss-3.2.5/server/default/deploy/opencrx-core-CRX-web.ear/ If there are any errors you must first fix them before you proceed. For troubleshooting please also refer to here. Example 5-5. JBoss running - last few lines of console output. [Server] JBoss (MX MicroKernel) [3.2.5 (build: CVSTag=JBoss_3_2_5 date=200406251954)] Started in 8s:739ms [Tomcat5] Saw org.jboss.system.server.started notification, starting connectors [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0%2F0.0.0.0-8080 [ChannelSocket] JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [JkMain] Jk running ID=0 time=0/130 config=null Now you are ready to continue with the openCRX QuickStart Guide or you can Install openCRX as Windows Service. Chapter 6. Install openCRX as Windows ServiceIf you want to install JBoss / openCRX on a Windows platform as a Windows service you can do this as follows:
Bibliography |
||||