Dashboard > Hippo CMS > ... > Deployment on Application Containers using WARs > Deployment on Tomcat 6 with MySQL and ActiveMQ
Deployment on Tomcat 6 with MySQL and ActiveMQ
Added by Bart van der Schans, last edited by Bartosz Oudekerk on Jun 16, 2008  (view change)
Labels: 


Required versions:

  • Hippo Repository 1.2.15 or newer
  • Hippo CMS 6.05.03 or newer
  • Java 5
  • Tomcat 6.0
  • ActiveMQ 5.0

This is a guideline for installing in the Hippo Repository, Hippo CMS and other Hippo software in Tomcat 6.0 with MySQL and ActiveMQ. This is by no means the only way to do it and should be treated as starting point for more complex configurations.

1. Prerequisites

1.1 Running

  • Sun Java 5
  • Running MySQL Server 4.1 or newer
  • A proxy (Apache + mod_proxy) for vhosting
  • The Hippo CMS MUST run in the context root

1.1 Building

  • SVN client
  • Maven (with xalan 2.7.0 in lib/endorsed)
  • Maven plugins: cocoon, fortress

2. Installing and configuring Tomcat with ActiveMQ and MySQL

2.1 Create MySQL databases

  • Create the Hippo Repository Slide database slide, schema: slide
  • Create the Hippo CMS database projectdata, schema: osworkflow, quartz

2.2 Donwload and install Tomcat 6.0

2.3 Donwload ActiveMQ

2.4 Add jars to the main lib/ folder of Tomcat

2.5 Create Tomcat Resources

  • Add the following config to the conf/context.xml of Tomcat. Make sure you define your database configuration correctly.
  • <Resource
                    name="jms/repositoryTCF"
                    auth="Container"
                    type="org.apache.activemq.ActiveMQConnectionFactory"
                    description="Repository JMS Connection Factory"
                    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                    brokerURL="vm://localhost"
                    brokerName="LocalActiveMQBroker"
                    useEmbeddedBroker="false" />
    
    	<Resource
                    name="jms/repositoryTopic"
                    description="JMS Repository Topic"
                    auth="Container"
                    type="org.apache.activemq.command.ActiveMQTopic"
                    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                    physicalName="jms/repostioryTopic" />
    
            <Resource
                    name="jdbc/repositoryDataSource" auth="Container" type="javax.sql.DataSource"
                    maxActive="20" maxIdle="10" minIdle="2" initialSize="2" maxWait="10000"
                    testOnBorrow="true" validationQuery="select 1 from dual"
                    poolPreparedStatements="true"
                    username="root" password="password"
                    driverClassName="com.mysql.jdbc.Driver"
                    url="jdbc:mysql://127.0.0.1:3306/slide?autoReconnect=true&amp;characterEncoding=utf8" />
    
            <Resource
                    name="jdbc/projectDataSource" auth="Container" type="javax.sql.DataSource"
                    maxActive="20" maxIdle="10" minIdle="2" initialSize="2" maxWait="10000"
                    testOnBorrow="true" validationQuery="select 1 from dual"
                    poolPreparedStatements="true"
                    username="root" password="password"
                    driverClassName="com.mysql.jdbc.Driver"
                    url="jdbc:mysql://127.0.0.1:3306/projectdata?autoReconnect=true&amp;characterEncoding=utf8" />
  • Start Tomcat: bin/startup.sh or bin/startup.bat
  • Tomcat should now be up-and-running

2.6

  • Add log4j.properties to lib (console is appended to catalina.out)
    log4j.rootLogger=DEBUG, stdout
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    
    # Print the date in ISO 8601 format
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c{2} %x - %m%n
    
    log4j.logger.org.apache=WARN
    log4j.logger.org.apache.activemq=INFO
    log4j.logger.httpclient=WARN
    log4j.logger.nl.hippo=INFO
    log4j.logger.nl.hippo.client=INFO
    log4j.logger.org.hippoecm=INFO
    log4j.logger.org.hippocms=INFO

2.7 Tomcat Java options

  • Create a JAVA_OPTS environment variable
  • Add max memory to JAVA_OPTS: -Xmx512m
  • ActiveMQ 4.1 or older note: Add to JAVA_OPTS: -Dorg.apache.activeio.journal.active.DisableLocking=true (see AMQ-704)

2.8 Optional: Configure Tomcat Manager

  • Configure an admin user for the Tomcat manager in conf/tomcat-users.xml
  • Restart Tomcat (bin/shutdown.sh, bin/startup.sh)
  • Go to http://localhost:8080/manager/html
  • Remove any unwanted applications

3. Download Wars (when not building your own)

4. Initialize the Hippo Repository

5. Building your own wars

5.1 Build Hippo Repository War

  • Checkout Hippo Repository from svn
  • Run:
    maven war
  • Rename the war file target/hippo-repository.war to default.war.
  • Upload and deploy the default.war in Tomcat (with the manager or just drop the war in the webapps/ folder)
  • Check that the repository is running at: http://localhost:8080/default/

5.2 Build Hippo CMS War

  • Checkout Hippo CMS from svn
  • Create the following build.properties file as editor/build.properties
    maven.cocoon.repository.host=localhost
    maven.cocoon.repository.port=8080
    maven.cocoon.site.domain=localhost
    maven.cocoon.hsqldb.use=false
    
    cms.datasource.workflow.jndi=java:comp/env/jdbc/projectDataSource
    cms.datasource.workflow.reference=jdbc/projectDataSource
    
    jms.connection.factory.jndi=java:comp/env/jms/repositoryTCF
    jms.topic.jndi=jms/repositoryTopic
    
    maven.cocoon.servermanager.configuration=example_project
    maven.cocoon.servermanager.configuration.dir=${basedir}/templates/example_project_mysql_J2EE
    maven.cocoon.servermanager.configurationlocation=context://WEB-INF/configuration
    maven.cocoon.servermanager.worklocation=context://WEB-INF/smwork
    
    maven.cocoon.site.directory=sites/hippo-cms/
    
    jms.jndi.initial.factory=nl.hippo.jmsbridge.BridgeContextFactory
    jms.jndi.secondary.factory=-
    jms.connection.factory=jms/repositoryTCF
    jms.topic=jms/repositoryTopic
    
    #---- WAR / EAR settings -----#
    maven.war.final.name=ROOT.war
  • Run:
    maven -d editor cocoon:war
  • Upload and deploy the ROOT.war in Tomcat (with the manager or just drop the war in the webapps/ folder)
  • Check that the repository is running at: http://localhost:8080/

5.3 Hippo Site Toolkit

  • Check out the jsp-example-app, see Hippo site toolkit documentation
  • Use the following live.properties:
    hippo.client.username = siteuser
    hippo.client.password = siteuser
    #
    hippo.client.protocol = http
    hippo.client.host = localhost
    hippo.client.port = 8080
    hippo.client.realm = default realm
    #
    hippo.client.namespace = default
    hippo.client.filespath = /files/default.www
    
    # Name of the JMS topic connection factory 
    hippo.client.jms.factory = jms/repositoryTCF
    hippo.client.jms.topic = jms/repositoryTopic
    hippo.client.jms.reconnect.delay = 1000
    
    java.naming.factory.initial=nl.hippo.jmsbridge.BridgeContextFactory
    java.naming.factory.secondary=-
    java.naming.provider.url=vm://localhost
    java.naming.factory.bindings=jms/repositoryTCF jms/repositoryTopic
    java.naming.factory.options=asynchronous-operations=emulate naming=prefix
  • Use the following preview.properties:
    #
    # WebDav configuration for the Hippo Repository Java adapter.
    # These default values are correct for an 'out of the box' instance of Hippo Repository
    #
    hippo.client.username = siteuser
    hippo.client.password = siteuser
    #
    hippo.client.protocol = http
    hippo.client.host = localhost
    hippo.client.port = 8080
    hippo.client.realm = default realm
    #
    hippo.client.namespace = default
    hippo.client.filespath = /files/default.preview
    
    # Name of the JMS topic connection factory 
    hippo.client.jms.factory = jms/repositoryTCF
    hippo.client.jms.topic = jms/repositoryTopic
    hippo.client.jms.reconnect.delay = 1000
    
    #hippo.client.jms.username = admin
    #hippo.client.jms.password = openjms
    
    java.naming.factory.initial=nl.hippo.jmsbridge.BridgeContextFactory
    java.naming.factory.secondary=-
    java.naming.provider.url=vm://localhost
    java.naming.factory.bindings=jms/repositoryTCF jms/repositoryTopic
    java.naming.factory.options=asynchronous-operations=emulate naming=prefix
  • Run:
    mvn package
  • Upload and deploy the war from the target directory

6. Troubleshooting

  • No log messages appear in catatlina.out
    • Make sure there are nog log4j jars in the WEB-INF/lib folders of the installed webapps
    • Turn on log4j debug messages in catalina.out by setting
      CATALINA_OPTS=-Dlog4j.debug -Dlog4j.configuration=log4j.properties

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.7 Build:#813 Aug 28, 2007) - Bug/feature request - Contact Administrators