Tuesday, December 13, 2011

Clone WebSphere

#1 - Create deployment manager on the target machine

  1. /usr/IBM/WebSphere/AppServer/bin/manageprofiles.sh -create -profileName Dmgr01 -templatePath /usr/IBM/WebSphere/AppServer/profileTemplates/management -serverType DEPLOYMENT_MANAGER -nodeName wstestapp-dm -cellName WC_comm01_cell -hostName localhost
  2. Review log file, /usr/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/AboutThisProfile.txt
  3. Make note of the “Managment SOAP connector port” as it’ll be used to federate, synchronize and change the node.
Application server environment to create: Management
Location: /usr/IBM/WebSphere/AppServer/profiles/Dmgr01
Disk space required: 30 MB
Profile name: Dmgr01
Make this profile the default: True
Node name: wstestapp-dm
Cell name: WC_comm01_cell
Host name: wsdevapp
Enable administrative security (recommended): False
Administrative console port: 9060
Administrative console secure port: 9043
Management bootstrap port: 9809
Management SOAP connector port: 8879
Run Management as a service: False

#2 - Create the nodes you want to move over on the target machine. These nodes need to have the same name as the nodes on the source machine but do not use the same cell name.

  1. /usr/IBM/WebSphere/AppServer/bin/manageprofiles.sh -create -profileName comm01 -templatePath /usr/IBM/WebSphere/AppServer/profileTemplates/managed -nodeName wstestapp-node -cellName bogusCellName -hostName localhost
  2. Review log file, /usr/IBM/WebSphere/AppServer/profiles/comm01/logs/AboutThisProfile.txt
Application server environment to create: Custom
Location: /usr/IBM/WebSphere/AppServer/profiles/comm01
Disk space required: 10 MB
Profile name: comm01
Make this profile the default: False
Node name: wstestapp-node
Host name: wsdevapp
Federate to deployment manager: False

#3 - Start the deployment manager created in step #1 in order to federate the node created in step #2.

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/startManager.sh

#4 - Federate the node created in step #2 on the target machine.

/usr/IBM/WebSphere/AppServer/profiles/comm01/bin/addNode.sh localhost 8879

#5 - Stop the node on the target machine.

/usr/IBM/WebSphere/AppServer/profiles/comm01/bin/stopNodes.sh

#6 - Stop the deployment manager on the target machine

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/stopManager.sh

#7 - Run a backup of the deployment manager on the source machine. Ensure that you add the “-nostop” option.

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/backupConfig.sh /tmp/Dmgr01.zip -nostop

#8 - Restore the deployment manager configuration from the backup in the previous step to the target machine.

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/restoreConfig.sh /tmp/Dmgr01.zip

#9 - Edit the following files to the correct host name of the target machine.

  1. /usr/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/WC_comm01_cell/nodes/wstestapp-node/serverindex.xml
  2. /usr/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/WC_comm01_cell/nodes/wstestapp-dm/serverindex.xml
  3. /usr/IBM/WebSphere/AppServer/profiles/Dmgr01/properties/wsadmin.properties
  4. /usr/IBM/WebSphere/AppServer/profiles/comm01/properties/wsadmin.properties

#10 - Start the deployment manager on the target machine.

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/startManager.sh

#11 - Synchronize the node on the target machine.

/usr/IBM/WebSphere/AppServer/profiles/comm01/bin/syncNode.sh localhost 8879

#12 - Start the node on the target machine.

/usr/IBM/WebSphere/AppServer/profiles/comm01/bin/startNodes.sh

#13 - Start the server on the target machine.

/usr/IBM/WebSphere/AppServer/profiles/comm01/bin/startServer.sh server1

#14 - Update the database configuration.

  1. Log into the console at https://wsdevapp.lifeway.org:9043/ibm/console
  2. Go to JDBC providers → comm01 - WebSphere Commerce JDBC Provider → Data Sources → WebSphere Commerce DB2 DataSource comm01 and modify the section, “Common and required data source properties”.
  3. Verify that the “DB2_JDBC_DRIVER_PATH” is correct. Go to Environment → WebSphere variables. Select “All scopes” from the pull down menu at the top and ensure the path points to the correct directory. The difference between dev and test is that the word, “ibm” is all capitalized on dev.
  4. Test the connection by going to JDBC providers → comm01 - WebSphere Commerce JDBC Provider → Data sources and checking the box next to name, WebSphere Commerce DB2 DataSource comm01 and selecting “Test connection”.

#15 - Modify Web Server Configuration

  1. Log into the console at https://wsdevapp.lifeway.org:9043/ibm/console
  2. Go to System administration → Nodes → wstestweb.lifeway.org-node and change the host name under the entry, “Host Name” from ws
  3. Go to Environment → Virtiual host and, one-by-one, select each Virtual Host listed below. After selecting a virtual host, you’ll select Host Aliases and for each of the host names listed change the entry under “Host Name” from wstestweb to wsdevweb. Note that changes are not need for virtual host aliases default_host, admin_host or proxy_host because they use use host name, “*”.
      Cache Monitor
      VH_comm01
      VH_comm01_Admin
      VH_comm01_OrgAdmin
      VH_comm01_Preview
      VH_comm01_Tools

Copy the plug-in configuration file from test to dev. The name and location of the file are shown below.

/usr/IBM/WebSphere/CommerceServer70/instances/default/httpconf/keyfile.kdb

#16 - Re-generate plug-in and propagate to IHS web server, wsdevweb.lifeway.org.

  1. Log into the console at https://wsdevapp.lifeway.org:9043/ibm/console
  2. Go to Servers → Web servers and check the box next to the name, “webserver1”. Select “Generate Plug-in”.
  3. After the plug-in is generated select, “Propagate Plug-in”.

#17 - Restart web and application services.

  1. Log into wsdevweb as sysadm, switch to the root account and issue the following command(s):
    • service ihs stop
      service ihs start
  2. Log into the application server as wasadmin and restart the application and issue the following command(s):
    • /usr/IBM/WebSphere/AppServer/profiles/comm01/bin/stopServer.sh server1
      /usr/IBM/WebSphere/AppServer/profiles/comm01/bin/startServer.sh server1

#18 - Rename the application node.

Log into the application server as wasadmin and issue the following command(s):

  1. /usr/IBM/WebSphere/AppServer/profiles/comm01/bin/stopServer.sh server1
  2. /usr/IBM/WebSphere/AppServer/profiles/comm01/bin/stopNode.sh
  3. /usr/IBM/WebSphere/AppServer/profiles/comm01/bin/renameNode.sh localhost 8879 wsdevapp-node
  4. Review the log, /usr/IBM/WebSphere/AppServer/profiles/comm01/logs/renameNode.log
  5. /usr/IBM/WebSphere/AppServer/profiles/comm01/bin/syncNode.sh localhost 8879
  6. cp /usr/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/WC_comm01_cell/nodes/wstestapp-node/node-metadata.properties /usr/IBM/WebSphere/AppServer/profiles/comm01/config/cells/WC_comm01_cell/nodes/wsdevapp-node/node-metadata.properties

#19 - Update the Commerce application.

    Edit the following file(s) and rename any reference from “test” to “dev”. There are references to the application, Mule in this file as well.

  1. /usr/IBM/WebSphere/AppServer/profiles/comm01/installedApps/DefaultCell/WC_comm01.ear/Stores.war/WEB-INF/classes/Lifeway/RSConfig.properties
  2. usr/IBM/WebSphere/AppServer/profiles/comm01/installedApps/DefaultCell/WC_comm01.ear/xml/config/wc-server.xml

Update the EAR.

/usr/IBM/WebSphere/Commerce70/bin/config_ant.sh -DinstanceName=comm01

#20 - Update ActiveMQ Settings

Verify that the following directory exists and that “.jar” files required for ActiveMQ are present. Copy from test if necessary.

/usr/IBM/WebSphere/AppServer/profiles/comm01/installedConnectors/

Modify the JMS providers.

  1. Log into the console at https://wsdevapp.lifeway.org:9043/ibm/console
  2. Go to Resources → JMS → JMS providers. Select “All scopes” from the menu at the top and select ActiveMQ JMS Provider. Change the entry under, “External provider URL to tcp://activemqdev:61616.
  3. Go to Resources → Resource Adapters → ActiveMQ JMS Resource Adapter → Custom Properties. Select ServerURL from the table and change the entry under, “Value” to tcp://activemqdev:61616

Wednesday, December 7, 2011

Alfresco Community Edition 4.0b Install Under JBoss

Overview

These are the instructions I arrived at for install Alfresco Community Edition 4.0b under JBoss. Much of this is taken from the Alfreso Wiki albeit documention is soemwhat scattered and hard to find. Feel free to comment and good luck!

Create the Alfresco MySQL database and Alfresco user.

mysql -u root -padmin

cut and past the following lines or run as a script (not noted here)

create database alfresco default character set utf8 collate utf8_bin;
grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

Get a Copy of Alfresco and JBoss

JBoss
mkdir /opt/community
cd /opt/community
wget http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA.zip
unzip jboss-5.1.0.GA.zip

Alfresco
mkdir alf
cd alf
unzip alfresco-community-4.0.b.zip
wget http://dl.alfresco.com/release/community/build-3835/alfresco-community-4.0.b.zip

You should now see the following:

[root@ericktwo community]# pwd
/opt/community
[root@ericktwo community]# ls
alf jboss-5.1.0.GA
[root@ericktwo community]#

Move Alfresco “Extension” Diretory to JBoss

Note that the Alfresco Wiki says to create an alfresco directory under (in this example) /opt/community/jboss-5.1.0.GA/server/default/conf/alfresco though I put in the directory shown and everything works.

mv /opt/community/alf/web-server/shared/classes/alfresco/extension /opt/community/jboss-5.1.0.GA/server/default/deploy/extension

Move and Explode “WAR” files under JBoss

Note that you’re renaming “.war” to “.jar”

mv /opt/community/alf/web-server/webapps/alfresco.war
/opt/community/jjboss-5.1.0.GA/server/default/deploy/alfresco.jar

mv /opt/community/alf/web-server/webapps/share.war /opt/community/jboss-5.1.0.GA/server/default/deploy/share.jar

Make required directories

mkdir alfresco.war share.war
cd /opt/community/jboss-5.1.0.GA/server/default/deploy

Move the “.jar” files to the associated “.war” directories.

mv alfresco.jar alfresco.war
mv share.jar share.war

Change to the appropriate directories and explode the “.jar” files.

cd alfresco.war
jar -xvf alfresco.jar
cd ..
cd share.war
jar -xvf share.jar

Reduce Logging

Note that I did not modify this as directed in the Alfresco Wiki.

<root>
     <priority value="INFO" />
     <appender-ref ref="CONSOLE"/>
     <appender-ref ref="FILE"/>
  </root>

JDBC Connector

Download the appropriate MySQL Connector/J from the MySQL website: http://dev.mysql.com/downloads/connector/j/ and place in the following JBoss directory:

/opt/community/jboss-5.1.0.GA/server/default/lib

MySQL Connection Pooling

Create connection pooling by creating the file, /opt/community/jboss-5.1.0.GA/server/default/deploy/mysql-ds.xml.

Note change the name of the MySQL database, user name and passowrd to match your environment.

<local-tx-datasource>
   <jndi-name>alfresco-datasource</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/alfresco</connection-url>
   <driver-class>org.gjt.mm.mysql.Driver</driver-class>
   <user-name>alfresco</user-name>
   <password>alfresco</password>
   <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
   <metadata>
   <type-mapping>mySQL</type-mapping>
   </metadata>
 </local-tx-datasource>

UTF8 Support

Edit the following file, /opt/beta/jboss-5.1.0.GA/server/default/deploy/jbossweb.sar/server.xml. You’ll see two sections (port 8080 and port 8009) that you’ll need to append, “URIEncoding=”UTF-8”” to as shown in bold.

Note that the Alfresco Wiki also says to modify, /opt/beta/jboss-5.1.0.GA/server/all/deploy/jbossweb.sar/server.xml as well though I did not do this for my install and everything appears to work.

<!-- A HTTP/1.1 Connector on port 8080 -->
   <Connector protocol="HTTP/1.1" port="8080" URIEncoding="UTF-8" address="${jboss.bind.address}"
            connectionTimeout="20000" redirectPort="8443" />
<!-- A AJP 1.3 Connector on port 8009 -->
   <Connector protocol="AJP/1.3" port="8009" URIEncoding="UTF-8" address="${jboss.bind.address}"
      redirectPort="8443" />

Hibernate

Edit the file,
/opt/community/jboss-5.1.0.GA/server/default/deployers/ejb3.deployer/META-INF/jpa-deployers-jboss-beans.xml

<entry>
<key>hibernate.bytecode.provider</key>
<value>cglib</value>
</entry>

Create Alfresco Global Properties

Create the file, /opt/community/jboss-5.1.0.GA/server/default/conf/alfresco-global.properties as shown below. Ensure that the “dir.root” directory and “dir.contentstore” directories exist. You can refer to the previous section, “MySQL Connection Pooling” above as the database name, database user and password should match the file, mysql-ds.xml.

Refer to the following website in obtaining Open Office, http://download.openoffice.org/other.html.

dir.root=/opt/alfresco/alf_data
dir.indexes=${dir.root}/lucene-indexes
dir.contentstore=/opt/alf_file_share/contentstore
dir.contentstore.deleted=/opt/alf_file_share/contentstore.deleted
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.pool.initial=10
db.pool.max=100
ooo.exe=/opt/openoffice.org3
ooo.enabled=false
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost:3306/${db.name}
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
index.recovery.mode=FULL
mail.host=smtp.lifeway.org
mail.port=25
cifs.enabled=true
cifs.serverName=alfresco-dev
cifs.ipv6.enabled=false
img.root=/usr/local/ImageMagick-6.6.9-10
swf.exe=/usr/local/swftools-0.9.0/bin

Edit Startup Options

Edit the file /opt/community/jboss-5.1.0.GA/bin/run.conf. to include JMX monitoring and automatic discovery of Alfresco by the Hyperic plugin. Add the section shown in bold to the “JAVA_OPTS” parameter.

JAVA_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true -Dcom.sun.management.jmxremote -Dalfresco.home=. -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

Also ensure that the following minimum values shown below as related to the Java heap. Modiy the “JAVA_OPTS” parameter shown above if requrired.

-Xms128m -Xmx512m -XX:MaxPermSize=128m

Edit the Filter Packages

Edit the file, /opt/community/jboss-5.1.0.GA/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml and replace the “WarClassLoaderDeployer” section with the following. This will avoid collisions between JVM bootstrap classes and those embedded in the “war”.

<bean name="WarClassLoaderDeployer" class="org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer">
    <property name="relativeOrder">-1</property>
    <property name="filteredPackages">javax.activation,javax.servlet,javax.servlet.jsp,javax.servlet.jsp.jstl,javax.servlet.jsp.jstl.core,javax.servlet.jsp.jstl.fmt,javax.servlet.jsp.jstl.sql,javax.servlet.jsp.jstl.tlv,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.messaging,javax.xml.namespace,javax.xml.parsers,javax.xml.rpc,javax.xml.rpc.encoding,javax.xml.rpc.handler,javax.xml.rpc.handler.soap,javax.xml.rpc.holders,javax.xml.rpc.server,javax.xml.rpc.soap,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.ws.wsaddressing,javax.xml.xpath,org.apache.commons.logging,org.apache.commons.logging.impl,org.apache.xerces,org.apache.xerces.dom,org.apache.xerces.dom.events,org.apache.xerces.dom3,org.apache.xerces.dom3.as,org.apache.xerces.impl,org.apache.xerces.impl.dtd,org.apache.xerces.impl.dtd.models,org.apache.xerces.impl.dv,org.apache.xerces.impl.dv.dtd,org.apache.xerces.impl.dv.util,org.apache.xerces.impl.dv.xs,org.apache.xerces.impl.io,org.apache.xerces.impl.msg,org.apache.xerces.impl.validation,org.apache.xerces.impl.xpath,org.apache.xerces.impl.xpath.regex,org.apache.xerces.impl.xs,org.apache.xerces.impl.xs.identity,org.apache.xerces.impl.xs.models,org.apache.xerces.impl.xs.opti,org.apache.xerces.impl.xs.traversers,org.apache.xerces.impl.xs.util,org.apache.xerces.jaxp,org.apache.xerces.jaxp.datatype,org.apache.xerces.jaxp.validation,org.apache.xerces.parsers,org.apache.xerces.util,org.apache.xerces.xinclude,org.apache.xerces.xni,org.apache.xerces.xni.grammars,org.apache.xerces.xni.parser,org.apache.xerces.xpointer,org.apache.xerces.xs,org.apache.xerces.xs.datatypes,org.apache.xml,org.apache.xml.resolver,org.apache.xml.resolver.apps,org.apache.xml.resolver.etc,org.apache.xml.resolver.etc.catalog.dtd,org.apache.xml.resolver.etc.catalog.rng,org.apache.xml.resolver.etc.catalog.xsd,org.apache.xml.resolver.etc.xcatalog.dtd,org.apache.xml.resolver.helpers,org.apache.xml.resolver.readers,org.apache.xml.resolver.tools,org.apache.xml.security,org.apache.xml.security.algorithms,org.apache.xml.security.algorithms.implementations,org.apache.xml.security.c14n,org.apache.xml.security.c14n.helper,org.apache.xml.security.c14n.implementations,org.apache.xml.security.encryption,org.apache.xml.security.exceptions,org.apache.xml.security.keys,org.apache.xml.security.keys.content,org.apache.xml.security.keys.content.keyvalues,org.apache.xml.security.keys.content.x509,org.apache.xml.security.keys.keyresolver,org.apache.xml.security.keys.keyresolver.implementations,org.apache.xml.security.keys.storage,org.apache.xml.security.keys.storage.implementations,org.apache.xml.security.resource,org.apache.xml.security.resource.schema,org.apache.xml.security.signature,org.apache.xml.security.transforms,org.apache.xml.security.transforms.implementations,org.apache.xml.security.transforms.params,org.apache.xml.security.utils,org.apache.xml.security.utils.resolver,org.apache.xml.security.utils.resolver.implementations,org.apache.xml.serialize,org.apache.xmlcommons,org.xml,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,org.w3c.css,org.w3c.css.sac,org.w3c.css.sac.helpers,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.smil,org.w3c.dom.stylesheets,org.w3c.dom.svg,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath</property>