OnlineGlom Installation log

From Glom
Revision as of 07:16, 20 April 2012 by Murrayc (Talk | contribs)

Jump to: navigation, search

Online Glom Installation Log

This was on an Ubuntu Precise beta2 Amazon AWS instance, specifically ami-b5ea34dc.

On the local computer

Build and upload the .war file

cd gwt-glom
mvn package
scp target/gwt-glom- -l murrayc

(I have installed my public ssh key on the server to make ssh/scp easier to use.)

On the server

Install the dependencies

sudo sudo add-apt-repository ppa:openismus-team/ppa
sudo apt-get update
sudo apt-get install tomcat7 glom-utils glom-doc libjava-glom-java apache2 libapache2-mod-jk

(glom-doc has the example files that we will use.)

Setup PostgresSQL

See Initial Postgres Configuration for fuller details about configuring PostgreSQL for desktop use. The steps here are just for use by OnlineGlom.

Create the PostgreSQL username and password

sudo -s -u postgres
postgres@ip-10-212-67-60:~$ createuser -P
Enter name of role to add: onlineglom
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) y

Edit pg_hba.conf

sudo nano /etc/postgresql/9.1/main/pg_hba.conf

Add this:

 local   all             onlineglom                              md5

after the existing line:

 local   all             postgres                                peer

Test the PostgreSQL connection

sudo service postgresql restart
glom_test_connection --server-hostname=localhost --server-port=5432 --server-username=onlineglom
Please enter the PostgreSQL server's password for the user onlineglom: 
Successful connection.

Create the Glom examples files and databases

glom_create_from_example --input=/usr/share/doc/glom/examples/example_smallbusiness.glom --output-path=/home/ubuntu/onlineglom_files/ --output-name=example_smallbusiness.glom --server-hostname=localhost --server-port=5432 --server-username=onlineglom
Using the PostgreSQL server with host: localhost
Please enter the PostgreSQL server's password for the user onlineglom: 
Database re-creation progress
Database re-creation progress
Glom file created at: /home/ubuntu/onlineglom_files/example_smallbusiness/example_smallbusiness.glom

Configure Tomcat

sudo nano /var/lib/tomcat7/shared/classes/

(Based on , with the PostgreSQL username and password.)

Change Tomcat's java.library.path

Note that this doesn't seem to be necessary on Ubuntu Precise:

sudo nano /etc/default/tomcat7

and change this line

JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"

to this:

JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/lib/jni:/usr/lib"
Install the java-libglom .jar in Tomcat
sudo cp /usr/share/java/java-libglom-1.21.4.jar /usr/share/tomcat7/lib/
Install the .war in Tomcat
sudo cp ~/gwt-glom- /var/lib/tomcat7/webapps/OnlineGlom.war
$ sudo tomcat7 start

sudo: tomcat7: command not found

Test Tomcat in your browser
$ sudo service tomcat7 restart
* Starting Tomcat servlet engine tomcat7

Test it in your browser, for instance at:

Configure Apache

Make Tomcat provide an AJP connection

 $ sudo sudo nano /etc/tomcat7/server.xml

Uncomment this line:

 <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

After this line:

 <Host name="localhost"  appBase="webapps"
           unpackWARs="true" autoDeploy="true">

Add this:

 <Context docBase="OnlineGlom" path="" />

Tell Apache to serve OnlineGlom via Tomcat

sudo nano /etc/apache2/sites-available/default

After this line:

 DocumentRoot /var/www

Add this line:

 JkMount /OnlineGlom/* ajp13_worker

Test Apache in your browser

sudo service apache2 restart

Test it in your browser, for instance at: (note that the closing / is necessary)

TODO: How can we make it work at: without the /OnlineGlom/