CDM Server Installation

The CDM Server can be installed on Linux , Mac OS X and of course on Windows. For detailed information on the requirements please refer to CDM Server - Requirements. For each CDM database a separate CDM remote web application instance will be launched which will require a significant amount of memory. The CDM server listens per default on port 8080 but can be configured to use another port. Installer packages for the CDM Server are provided in the download section as Debian package and as an executable Windows installer application.

In the following the steps required to install and set up a CDM Server are described for Debian Linux and for Windows XP. Where necessary the platform dependant steps are described fro each operation system individually.

In the following it is assumed that the CDM Server installation is available from the this URL: (http://CDMServer.com/).

CDM Server requirements

Read the CDM Server - Requirements document and make sure that your environment meets the mentioned hardware and software requirements of CDM Server. Install any additional software needed before downloading the CDM Server.

Step 1. Download

Linux

  • Download the latest stable release of the Debian package (cdmserver_x.x.x.-5_all.deb) from the download site.

Windows

  • Download the latest stable release of the Windows installer executable (EDIT CDM-Server-x.x.exe) from the download site.

Step 2. Installation

The automated installation of the CDM Server configures the server per default to listen on port 8080. If you already have another service using this port you have to change the configuration (see step 3 below) in order to allow the server to startup.

Linux

  • First of all you need to install an additional package:
    sudo apt-get install jsvc
  • Go to the directory to where you downloaded the Debian package and install it by executing

    dpkg -i cdmserver_x.x.x.-5_all.deb

    The resulting output on the terminal should look like the following:

    Selecting previously deselected package cdmserver.
    (Reading database ... 31748 files and directories currently installed.)
    Unpacking cdmserver (from ../cdmserver_0.0.1-1_amd64.deb) ...
    Setting up cdmserver (0.0.1-1) ...
     Adding system startup for /etc/init.d/cdmserver ...
       /etc/rc0.d/K02cdmserver -> ../init.d/cdmserver
       /etc/rc1.d/K02cdmserver -> ../init.d/cdmserver
       /etc/rc6.d/K02cdmserver -> ../init.d/cdmserver
       /etc/rc2.d/S98cdmserver -> ../init.d/cdmserver
       /etc/rc3.d/S98cdmserver -> ../init.d/cdmserver
       /etc/rc4.d/S98cdmserver -> ../init.d/cdmserver
       /etc/rc5.d/S98cdmserver -> ../init.d/cdmserver
    Starting CDM Server: cdmserver with -Xmx1024M -jar /opt/cdmserver//cdmserver-standalone.jar --httpPort=8080
    --ajp13Port=-1 --logfile=/var/log/cdmserver/cdmserver.log
  • The CDM Server has now been installed on /opt/cdmserver. An according "ini" script has been created at /etc/init.d/cdmserver. Finally the server has been started.
  • The CDM Server configuration files are found in
    /opt/cdmserver/.cdmLibrary
  • The CDM server can now run with this configuration, but you may want to do further configureation to assign it enough memory and for best performance. Therefore we highly recommend installing the latest Oracle JDK 1.7 and to configure the CDM Server accordingly. Debian and Ubuntu are not including the oracle jdk in the packages so you have to install it manually. After installing the oracle jdk 1.7 you have to create the following file: /etc/defaults/cdmserver

    #/etc/defaults/cdmserver

    # The JAVA_HOME variable
    # must point to the location of the jdk you want to run the CDM Server with
    JAVA_HOME=/opt/java-oracle/jdk1.7.0_25

    # determine the number of processors available in the system
    CPU_CORES=$(nproc)

    # memory configuration
    JAVA_OPTIONS="-Xmx1024M -XX:PermSize=128m -XX:MaxPermSize=512m"
    # best garbage collection settings for jdk 1.7
    JAVA_OPTIONS="$JAVA_OPTIONS -XX:+UseG1GC -XX:ParallelGCThreads=${CPU_CORES} -XX:ConcGCThreads=${CPU_CORES} -Duser.home=$CDM_HOME"

Windows

  • Execute the downloaded installer (EDIT CDM-Server-x.x.exe) and follow the instructions. The CDM Server will be installed as windows service and is being started after prior installation steps have completed.
  • By default the installer will install the CDM server into the folder "%PROGRAMFILES%/EDIT CDM-Server/" folder. %PROGRAMFILES% usually is "C:\Program Files\" on Windows systems with english localization.
  • The CDM Server configuration files are found in
    %PROGRAMFILES%/EDIT CDM-Server/.cdmLibrary

Step 3. Configuration

During the previous step the CDM Server has been installed. Now navigate with your web browser to the CDM Server root (http://CDMServer.com:8080/). Access to this page is restricted, thus you are being presented a sign-in box. Unless you change the credentials which are defined in .cdmLibrary/cdm-server-realm.properties file the CDM Server will use the default: user=admin, password=edit. For security reasons it is highly recommended that you change the credentials as soon as possible. If you have problems locating the .cdmLibrary/cdm-server-realm.properties file please refer to Step 2. Installation.  The respective file is a java properties file defining the users, passwords and roles for a Jetty-HashUserRealm (please refer to http://docs.codehaus.org/display/JETTY/Realms as reference).

After succesful login, you should see an administrative overview on the CDM Server like shown in the image below. This page will reports an error since the server has been installed without connecting it to an existing CDM database:

  • Open the datasources configurations file .cdmLibrary/datasources.xml with your favorite text editor. For the exact location of the .cdmLibrary folder see above.
  • Edit the data source bean settings:
    <bean id="MyBeanIdentifier" lazy-init="true" class="com.mchange.v2.c3p0.ComboPooledDataSource">
       <property name="driverClass" value="com.mysql.jdbc.Driver"/>
       <property name="username" value="MyUserName"/>
       <property name="password" value="MyPassword"/>
       <property name="url" value="jdbc:mysql://MyDatabaseAddress/MyDatabaseName"/>
    </bean>
  • You can define multiple data source beans in the datasources.xml file so you can configure the server to expose multiple databases ot once. For each CDM database a separate CDM remote web application instance will be launched which will require a significant amount of memory (see CDM Server - Requirements for more information).

    The bean id will be used as name of the specific web application instance and specifies the base path at which the according webservices are available. This path is shown in the administrative overview of the CDM Server (http://CDMServer.com:8080/).

  • Once you configured your database restart the CDM Server:
    • Linux: Execute the following command in your terminal:
      /etc/init.d/cdmserver restart

      or

      service /etc/init.d/cdmserver restart
    • Windows: Go to the CDM Server application folder and execte the stop and start batch files in %PROGRAMFILES%/EDIT CDM-Server/:
      1. stop-service.bat
      2. start-service.bat
  • Test your configuration by navigating with your web browser to the CDM Server root (http://CDMServer.com:8080/). Now the CDM server should list the newly configured datasource. The status row should indicate the status &quot;started&quot; If the startup process is not jet finishes the status is &quot;initializing and shoudl swith to &quot;started&quot; after some time. This may take several minutes, so please be patient.

Advanced Configuration

The CDM Server can be started with different commanline options with are listed in the following. In order to apply these options to a CDM Server running as service you have to edit different configuration files on each platform:

Linux

  • Edit /etc/init.d/cdmserver
  • restart the server:
    /etc/init.d/cdmserver restart

Windows

  • Edit %PROGRAMFILES%\EDIT CDM-Server\etc\CDMServer.conf
  • Reinstall the serverbatch by executing the following batch files in %PROGRAMFILES%/EDIT CDM-Server/:
    1. remove-service.bat
    2. install-service.bat
    3. start-service.bat

Commandline Options

 -datasources <datasourcesfile>   use the specified datasources file.
Default is
{user.home}/.cdmLibrary/datasources.xml
-help print this message
-httpPort <httpPortNumber> set the http listening port. Default is
8080
-jmx Start the server with the Jetty MBeans
in JMX Management mode.
For testing you can use the following
jvm options:
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authentic
ate=false
-Dcom.sun.management.jmxremote.port=9999
-webapp <file> use the specified webapplication this
either can be a compressed war or
extracted file. If this option is used
extraction of the war from the cdmserver
jar file is omitted.Using the following
paths developers can run the server
completely from the target folder or
completely from source:
'{cdmlib-project-root}/cdmlib-remote/tar
get/cdmserver'
'{cdmlib-project-root}/cdmlib-remote/src
/main/webapp'
-win32service ONLY USED INTERNALLY - prepare for
running as win32 service, the server
will not be started automatically!

Uninstalling

Linux

  • For removing the cdm package just execute
    dpkg -r cdmserver

Windows

  • Execute the uninstaller executable %PROGRAMFILES%/EDIT CDM-Server/uninstall.exe and follow the instructions.