Development/OnlineGlom/Deployment

From Glom
< Development | OnlineGlom(Difference between revisions)
Jump to: navigation, search
(.glom file and configuration: Update the link to onlineglom.properties)
Line 7: Line 7:
 
We will install OnlineGlom in a Tomcat server. The instructions for installing tomcat are beyond the scope of this document. However, this might help on Ubuntu:
 
We will install OnlineGlom in a Tomcat server. The instructions for installing tomcat are beyond the scope of this document. However, this might help on Ubuntu:
 
https://help.ubuntu.com/11.04/serverguide/C/tomcat.html
 
https://help.ubuntu.com/11.04/serverguide/C/tomcat.html
 +
 +
== Dependencies ==
 +
 +
On Ubuntu, you will need these packages on the server: tomcat, postgresql, openjdk6-jdk, libglom-1.20.
 +
 +
TODO: Use openjdk6-jre instead of openjdk6-jdk when gwt-glom is packaged instead of needing to be built.
 +
 +
Also, the glom-utils package might be useful to deploy Glom example files. You should not need the glom package.
  
 
== .glom file and configuration ==
 
== .glom file and configuration ==

Revision as of 04:58, 21 October 2011

Contents

OnlineGlom Deployment

OnlineGlom really isn't ready for deployment, but you can try it locally. Nevertheless, here are some deployment instructions so that it's documented as the development progresses.

Tomcat

We will install OnlineGlom in a Tomcat server. The instructions for installing tomcat are beyond the scope of this document. However, this might help on Ubuntu: https://help.ubuntu.com/11.04/serverguide/C/tomcat.html

Dependencies

On Ubuntu, you will need these packages on the server: tomcat, postgresql, openjdk6-jdk, libglom-1.20.

TODO: Use openjdk6-jre instead of openjdk6-jdk when gwt-glom is packaged instead of needing to be built.

Also, the glom-utils package might be useful to deploy Glom example files. You should not need the glom package.

.glom file and configuration

These instructions assume that you have a PostgreSQL setup on your server with your glom database already loaded.

  • The first thing you need to do is scp your .glom file to your server.
  • Now set your PostgreSQL username, password and the location of the glom file in the OnlineGlom configuration properties file:
http://gitorious.org/online-glom/gwt-glom/blobs/master/src/main/resources/onlineglom.properties

Deploying java-libglom

NOTE: This assumes that the server has the same architecture and installed dependencies as your locale machine.

  • Setup java-libglom in your home directory on your server. You can use the instructions listed in the Building and Running section above but you'll need to change a couple of things. You don't need to install the jar into a local maven repository so you don't need to install maven2 with apt-get. You should also turn off the installation of the java-libglom jar into your local maven repository.
  • Copy java-libglom.modules to your home directory and edit it to remove this string:

autogenargs="--enable-maven-install"

  • Edit ~/.jhbuildrc and change the moduleset option to the location of the java-libglom.modules file you just copied into your home directory. Change this line:

moduleset = 'http://gitorious.org/online-glom/java-libglom/blobs/raw/master/tools/build/java-libglom.modules'

to this:

moduleset = 'file://' + os.path.expanduser('~/java-libglom.modules')

  • If you've already setup java-libglom and you just want to use the latest version from git master, run this set of commands:
jhbuild cleanone java-libglom && jhbuild buildone java-libglom
  • Tomcat needs to be able to "see" the .so from java-libglom so you need to edit /etc/default/tomcat6 and add the absolute path to the directory that has the java-libglom .so. Look for 'java.library.path' and add '/home/yourusername/gnome/install/lib64' to the first entry of that setting. Here's what that setting looks like on my server:
JAVA_OPTS="${JAVA_OPTS} -XX:+UseConcMarkSweepGC -Djava.library.path=/home/ben/gnome/install/lib64:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib"
You only need to configure tomcat like this once. NOTE: This is a big hack that will go away when java-libglom packages show up for various Linux distros.
  • Once tomcat is configured, copy the java-libglom jar in the tomcat lib directory. Since java-libglom uses jni it can only be loaded once and must not be included in the war. The proper place for it is $CATALINA_HOME/lib which is defined as /usr/share/tomcat6/lib/ on Ubuntu 10.04. More information about this issue can be found in the Tomcat 6 release notes in the "JNI Based Applications" section:
http://tomcat.apache.org/tomcat-6.0-doc/RELEASE-NOTES.txt
This is the command to run to copy the jar in into the correct directory:
sudo cp ~/gnome/install/share/java/java-libglom-0.1.jar /usr/share/tomcat6/lib/

Deploying gwt-glom

  • Alright stop. It's compile time! These instructions assume your in the gwt-glom directory.
  • Clean-out the target directory:
rm -rf target/* target/.*
This isn't always necessary but I do it every time because I've encountered too many problems with mismatched GWT versions.
  • Now compile the Java code, run the GWT to Javascript compilation and package up the war:
mvn clean package
  • And scp the war to your server:
scp target/gwt-glom-1.0-SNAPSHOT.war servername.com:
  • Finally we can deploy the war.
  • Stop tomcat:
sudo /etc/init.d/tomcat6 stop
  • Copy the war to the deployment directory:
sudo cp ~/gwt-glom-1.0-SNAPSHOT.war /var/lib/tomcat6/webapps/OnlineGlom.war
  • Start tomcat
sudo /etc/init.d/tomcat6 start
Personal tools
Namespaces

Variants
Actions
Navigation
Tools