Difference between revisions of "OnlineGlom Installation log"
(→Make Tomcat provide an AJP connection) |
(→Install the .war in Tomcat) |
||
Line 91: | Line 91: | ||
sudo cp ~/gwt-glom-1.21.8.1.war /var/lib/tomcat7/webapps/OnlineGlom.war | sudo cp ~/gwt-glom-1.21.8.1.war /var/lib/tomcat7/webapps/OnlineGlom.war | ||
− | + | sudo service tomcat7 start | |
===== Test Tomcat in your browser ===== | ===== Test Tomcat in your browser ===== |
Revision as of 07:17, 20 April 2012
Contents
- 1 Online Glom Installation Log
- 1.1 On the local computer
- 1.2 On the server
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.8.1.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 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 ... 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
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 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-1.21.8.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 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: 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/