Running two instances of Dekoh Desktop on your machine

Developers run two instances of Dekoh on their desktop to:

  • Share content with friends. This instance runs 24x7.
  • Deploy and test their applications. This is a development instance, requiring regular restarts and database cleanups.

How do I run two instances of Dekoh Desktop on my machine?

Install Dekoh Desktop, rename it, and change the port. Then install another Dekoh Desktop as the second instance.

Setting up the first instance of Dekoh Desktop

To set up the first instance of Dekoh Desktop:

  1. Install Dekoh Desktop from http://www.dekoh.com/. Successful installation starts the Desktop Portal. Shut it down by clicking the Shutdown link on the top right-hand corner.
  2. Next, rename the installation directory to say, DekohLive. This is your first instance, maybe for sharing content and networking with your friends. Depending on your OS, Dekoh is installed in one of these locations:
    1. On Windows: C:\Dekoh or (systemroot\Dekoh if your root drive is not C)
    2. On Linux/Unix and variants: /userhomedirectory/Dekoh
    3. On Mac OS X: /userhomedirectory/Dekoh
  3. Dekoh usually runs on Port 80 on Windows and 1025 on Mac. Change the port in the file: DekohLive/server/nodes/default/config/dasSysArguments.properties.
If the port is in use by another application, Dekoh takes the next available one. Any port other than 80 (or 1025) should be given in the URL: http://localhost:<new_port>/dekohportal.

For Windows users only: Open DekohLive/server/bin/dekoh.vmoptions and change the value of -DinstallDir to point to the DekohLive location. For example, -DinstallDir=C:\DekohLive. Make the same change in DekohLive/server/bin/dekoh-service.vmoptions.

Now that you have your DekohLive instance set up for friends to share with, set up your developer instance of Dekoh.

Setting up the second instance of Dekoh Desktop

To set up the second instance of Dekoh Desktop:

  1. Install Dekoh Desktop from http://www.dekoh.com/. This will download and install Dekoh again in your default directory. Successful installation starts the Desktop Portal. Shut it down by clicking the Shutdown link on the top right-hand corner.
  2. This instance will be in the default directory (system drive root on Windows and home directory on Mac and Linux). This is your second instance - the dev instance - where you develop and test your applications. No changes are required for this instance.
  3. To start your dev instance using the command line, go to Dekoh/server/bin and run dekoh_shell.bat or dekoh_shell.sh (depending on your OS).
  4. This starts your development instance and present you with a command line prompt which says LWT>. Type help to see a list of available commands.
  5. Starting your dev instance using the command line has two advantages:
    1. You can use the command line interface of Dekoh for deploying, undeploying, starting, and stopping applications.
    2. You can see the error stack traces and messages on the command line window itself which is very handy for developers.

Your development instance is up now! Note that this is separate from the other instance that you will be running (DekohLive) and changes to this instance are not reflected in the other and vice versa.

For Linux users only:

Go to your user home directory and modify dekoh.sh so that the paths inside point to DekohLive. For example, after modification your dekoh.sh will look like this: #!/bin/sh cd /home/barc/DekohLive/server/bin LIB_DIR=../lib CLASSPATH=$LIB_DIR/pramati/classpath.jar export LIB_DIR export CLASSPATH /root/jdk1.5.0_06/jre/bin/java -DinstallDir=/home/barc/DekohLive com.pramati.bfly.install.BaseInitializer

Note: The paths will differ on your system.

For Mac users only:

Go to DekohLive/server/bin and modify dekoh.sh so that the paths inside point to DekohLive. For example, after modification your dekoh.sh will look like this: #!/bin/sh cd /home/barc/DekohLive/server/bin LIB_DIR=../lib CLASSPATH=$LIB_DIR/pramati/classpath.jar export LIB_DIR export CLASSPATH /root/jdk1.5.0_06/jre/bin/java -DinstallDir=/home/barc/DekohLive com.pramati.bfly.install.BaseInitializer

Note: The paths will differ on your system.

Starting the first instance

Let us start your DekohLive instance now.

For Linux users: To start DekohLive, run the script /yourhomedirectory/dekoh.sh

For Mac users: To start DekohLive, run the script DekohLive/server/bin/dekoh.sh

For Windows users: To start DekohLive, use the following steps. These steps ensure that your DekohLive instance will always start up automatically as a Windows service during Windows bootup. Note that the shortcut on your desktop will not point to DekohLive because you renamed your Dekoh directory.

  1. Go to DekohLive/server/bin
  2. Execute the following scripts in the sequence provided:
    1. remove-service.bat
    2. install-service.bat
  3. Type: net start Dekoh

You can access DekohLive instance by pointing your browser to http://localhost:<port>/dekohportal, where port is the port you changed earlier for your live instance.

The dev instance is already started. You can access it in the following ways:

  • Click the shortcut on your desktop (for Windows and Mac). This opens the dev instance in your default browser.
  • Access http://localhost:<devport>/dekohportal on any OS. devport refers to the default port, normally 1025 for Linux.

Both instances of Dekoh should be running and accessible now.

Starting the second instance

You can start the Dekoh dev instance by going to Dekoh/server/bin and running dekoh_shell.bat or dekoh_shell.sh. This depends on your OS.

Typing shutdown on the command prompt LWT> shuts down your Dekoh dev instance.

Troubleshooting

  • Problem: My Dekoh dev instance fails to start up.
  • Solution: Verify that Java is in your path. To find out, type echo %PATH%. If you do not see a valid directory in your path, (like C:\JDK1.5.0_06\bin or /home/user/jdk1.5.0_06/bin) set it. You can also set the JAVA_HOME variable to point to C:\JDK1.5.0_06\ or /home/user/jdk1.5.0_06/ instead of setting the path. The dekoh_shell.bat/sh file would pick it up from the JAVA_HOME variable.