Difference between revisions of "OnlineGlom Installation log"

From Glom
Jump to: navigation, search
(Test Tomcat in your browser)
(Simplify now that we don't need java-libglom.)
 
Line 9: Line 9:
 
  cd gwt-glom
 
  cd gwt-glom
 
  mvn package
 
  mvn package
  scp target/gwt-glom-1.21.8.1.war -l murrayc ubuntu@ec2-107-22-102-29.compute-1.amazonaws.com:/home/ubuntu/
+
  scp target/gwt-glom-1.21.9.war -l murrayc ubuntu@ec2-107-22-102-29.compute-1.amazonaws.com:/home/ubuntu/
  
 
(I have installed my public ssh key on the server to make ssh/scp easier to use.)
 
(I have installed my public ssh key on the server to make ssh/scp easier to use.)
Line 15: Line 15:
 
== On the server ==
 
== On the server ==
  
=== Install the dependencies ===
+
=== Install Packages ===
  
  sudo sudo add-apt-repository ppa:openismus-team/ppa
+
  sudo add-apt-repository ppa:openismus-team/ppa
 
  sudo apt-get update
 
  sudo apt-get update
  sudo apt-get install tomcat7 glom-utils glom-doc libjava-glom-java apache2 libapache2-mod-jk
+
  sudo apt-get install tomcat7 apache2 libapache2-mod-jk glom-utils glom-doc
  
(glom-doc has the example files that we will use.)
+
glom-utils and glom-doc are not really needed, but they will help us to create example Glom systems for testing. For instance, glom-doc has the example files that we will use. These are the only packages that need the openismus-team PPA.
  
 
=== Setup PostgresSQL ===
 
=== Setup PostgresSQL ===
Line 58: Line 58:
 
==== Create the Glom examples files and databases ====
 
==== Create the Glom examples files and databases ====
  
 +
mkdir /home/ubuntu/onlineglom_files
 
  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
 
  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
 
  Using the PostgreSQL server with host: localhost
Line 72: Line 73:
  
 
  sudo nano /var/lib/tomcat7/shared/classes/onlineglom.properties
 
  sudo nano /var/lib/tomcat7/shared/classes/onlineglom.properties
(Based on http://gitorious.org/online-glom/gwt-glom/blobs/master/src/main/resources/onlineglom.properties.sample , with the PostgreSQL username and password.)
+
(Based on http://gitorious.org/online-glom/gwt-glom/blobs/master/src/main/resources/onlineglom.properties.sample , with the correct directory path and 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 =====
 
===== Install the .war in Tomcat =====
  
  sudo cp ~/gwt-glom-1.21.8.1.war /var/lib/tomcat7/webapps/OnlineGlom.war
+
  sudo cp ~/gwt-glom-1.21.9.1.war /var/lib/tomcat7/webapps/OnlineGlom.war
 
  sudo service tomcat7 start
 
  sudo service tomcat7 start
  
Line 105: Line 92:
 
==== Make Tomcat provide an AJP connection ====
 
==== Make Tomcat provide an AJP connection ====
  
   sudo sudo nano /etc/tomcat7/server.xml
+
   sudo nano /etc/tomcat7/server.xml
  
 
Uncomment this line:
 
Uncomment this line:
Line 127: Line 114:
 
==== Test Apache in your browser ====
 
==== Test Apache in your browser ====
  
 +
sudo service tomcat7 restart
 
  sudo service apache2 restart
 
  sudo service apache2 restart
  

Latest revision as of 00:21, 16 May 2012

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-1.21.9.war -l murrayc ubuntu@ec2-107-22-102-29.compute-1.amazonaws.com:/home/ubuntu/

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

On the server

Install Packages

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

glom-utils and glom-doc are not really needed, but they will help us to create example Glom systems for testing. For instance, glom-doc has the example files that we will use. These are the only packages that need the openismus-team PPA.

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
...
exit

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

mkdir /home/ubuntu/onlineglom_files
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

Create onlineglom.properties
sudo nano /var/lib/tomcat7/shared/classes/onlineglom.properties

(Based on http://gitorious.org/online-glom/gwt-glom/blobs/master/src/main/resources/onlineglom.properties.sample , with the correct directory path and PostgreSQL username and password.)

Install the .war in Tomcat
sudo cp ~/gwt-glom-1.21.9.1.war /var/lib/tomcat7/webapps/OnlineGlom.war
sudo service tomcat7 start
Test Tomcat in your browser
sudo service tomcat7 restart
Starting Tomcat servlet engine tomcat7

Test it in your browser, for instance at: http://ec2-107-22-102-29.compute-1.amazonaws.com:8080/OnlineGlom/

Configure Apache

Make Tomcat provide an AJP connection

 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 tomcat7 restart
sudo service apache2 restart

Test it in your browser, for instance at: http://ec2-107-22-102-29.compute-1.amazonaws.com/OnlineGlom/ (note that the closing / is necessary)

TODO: How can we make it work at: http://ec2-107-22-102-29.compute-1.amazonaws.com without the /OnlineGlom/