Installing Continuum Standalone

Basics & Fundamentals

  • Download the standalone version from the Download page
  • Extract the file
  • Set a JAVA_HOME environment variable which use a jdk >= 1.5

Defining JNDI Resources

Mail server configuration

Before you start Continuum, you must configure your SMTP configuration for mail notification. The configuration is in $CONTINUUM_HOME/conf/jetty.xml:

<New id="validation_mail" class="org.mortbay.jetty.plus.naming.Resource">
  <Arg>mail/Session</Arg>
  <Arg>
    <New class="org.mortbay.naming.factories.MailSessionReference">
      <Set name="user"></Set>
      <Set name="password"></Set>
      <Set name="properties">
        <New class="java.util.Properties">
          <Put name="mail.smtp.host">localhost</Put>
        </New>
      </Set>
    </New>
  </Arg>
</New>
Databases configuration

By default, Continuum use an embedded Derby database. If you want to use an other database, you can modify the JNDI configuration in $CONTINUUM_HOME/conf/jetty.xml:

  <!-- continuum database -->
   
  <New id="continuum" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/continuum</Arg>
    <Arg>
      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/continuum</Set>
        <Set name="user">sa</Set>
        <Set name="createDatabase">create</Set>
      </New>
    </Arg>
  </New>

  <New id="continuumShutdown" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/continuumShutdown</Arg>
    <Arg>
      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/continuum</Set>
        <Set name="user">sa</Set>
        <Set name="shutdownDatabase">shutdown</Set>
      </New>
    </Arg>
  </New>
 
  <!-- Users / Security Database -->
  
  <New id="users" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/users</Arg>
    <Arg>
      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/users</Set>
        <Set name="user">sa</Set>
        <Set name="createDatabase">create</Set>
      </New>
    </Arg>
  </New>

  <New id="usersShutdown" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/usersShutdown</Arg>
    <Arg>
      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/users</Set>
        <Set name="user">sa</Set>
        <Set name="shutdownDatabase">shutdown</Set>
      </New>
    </Arg>
  </New>
  

Installing as a Windows Service

  • Go to $CONTINUUM_HOME/bin/ and run the following command:
    continuum.bat install
  • Edit the Apache Continuum service
    • To see the services that are on your computer go to Start|Run and enter services.msc.
  • Select the Startup Type
  • Go to the Log On tab and select a real user. A real user is required because you'll need a home directory for Maven repository and some other things
  • Validate your changes

Installing as a Linux Service

Since the Continuum Linux script bin/continuum understands the same arguments as Linux boot scripts, there is no need to write a particular startup script to add Continuum to the Linux boot process. All you need to do, as root, is:

Basic script in /etc/init.d

  • Create a continuum file under /etc/init.d/ with the following content. Replace continuum_user with the name of an account you have already created.
    #!/bin/sh
    
    CONTINUUM_HOME=/opt/continuum-1.3
    su - continuum_user -c "$CONTINUUM_HOME/bin/continuum console $@ &"

On a Debian-based system

ln -s /usr/local/continuum-[VERSION]/bin/continuum /etc/init.d/continuum

At this point you have Continuum ready to be symlinked from different runlevels. This might sound a bit esoteric, but it is not. You will find these words very fast as soon as you start reading about the init process. Fortunately, Debian GNU/Linux comes with a very handy utility to create these links, just run as root:

update-rc.d -n continuum defaults 80

If you run this command, you will see something like this:

 Adding system startup for /etc/init.d/continuum ...
   /etc/rc0.d/K80continuum -> ../init.d/continuum
   /etc/rc1.d/K80continuum -> ../init.d/continuum
   /etc/rc6.d/K80continuum -> ../init.d/continuum
   /etc/rc2.d/S80continuum -> ../init.d/continuum
   /etc/rc3.d/S80continuum -> ../init.d/continuum
   /etc/rc4.d/S80continuum -> ../init.d/continuum
   /etc/rc5.d/S80continuum -> ../init.d/continuum

What you see is the symlinks that would be created. The above command didn't actually create anything because of the -n switch. Remove that switch and run the command again to have the real links created.

On a RedHat-based system

Configuring Continuum on a RedHat-based system (like Fedora Core) is slightly different. Instead of running update-rc.d, you need to add a new service using the chkconfig command. In order to add Continuum using chkconfig, it is necessary to add some comments to the /etc/rc.d/init.d/continuum script and run a couple of commands. These tasks are executed by running the chkconfig_install.sh script below. Note that _continuum_user_ needs to be replaced by the name of an account you have already created.

#! /bin/sh
#
# chkconfig_install.sh - install Continuum on a chkconfig-based system
#
# Author: Felipe Leme <felipeal at apache.org>
#

# figure out what's Continuum's directory
CONTINUUM_HOME=`dirname $0`
cd ${CONTINUUM_HOME}
CONTINUUM_HOME=`pwd`

INITD_SCRIPT=/etc/rc.d/init.d/continuum

if [ -f ${INITD_SCRIPT} ]
then
  echo "File ${INITD_SCRIPT} already exists. Please remove it and try again."
  exit 1
fi

echo "Creating file ${INITD_SCRIPT}"
cat >> ${INITD_SCRIPT} <<EOF
#! /bin/sh
# chkconfig: 345 90 10
# description: Apache Continuum server

# uncoment to set JAVA_HOME as the value present when Continuum installed
#export JAVA_HOME=${JAVA_HOME}

if [ -z "\${JAVA_HOME}" ]
then
  echo "Cannot manage Continuum without variable JAVA_HOME set"
  echo "  (try to set it on file ${INITD_SCRIPT})"
  exit 1
fi
# run Continuum as root
cd ${CONTINUUM_HOME}
./bin/continuum \$*
# run Continuum as user _continuum_user_
#su - _continuum_user_ -c "cd ${CONTINUUM_HOME}; ./bin/continuum \$*"
EOF
chmod +x ${INITD_SCRIPT}

echo "Adding Continuum to chkconfig"
chkconfig --add continuum

echo "Enabling Continuum on chkconfig"
chkconfig continuum on
echo "Continuum set to start on run levels 3, 4 and 5."
echo "To start Continuum now, run 'service continuum start'"