Hi Paul,
I haven't done this in an EC2 AMI, but have already installed in my own VM.
I've followed the instructions indicated in:
I customized them... this is my working version:
cd transitdatafeeder-read-only/datafeeder
======================
#Some pre-requisites for this process:
#You'll need:
# - Java 1.5 or newer
#Instalar Java
apt-get update
apt-get install -y oracle-java6-installer
# En ubuntu server
locale-gen en_US.UTF-8
dpkg-reconfigure locales
#Mac and Linux distros by default)
apt-get install -y ant1.7
# - a Subversion (svn) client
apt-get install -y subversion
apt-get install -y zip screen
# - JBoss 5.1 (note: the installation will fail on JBoss 6.0!)
# - postgresql (tested with 8.4 and 9.0)
apt-get install -y postgresql
#1) checkout tdf
#---------------------------------------------------------------------
# You will need subversion for this.
# At the time of this writing, r6 was the newest revision in the
# repository.
#2) prepare the database
#---------------------------------------------------------------------
#2a) install postgresql. This actually depends on the operating system
#your using. I got tdf working with postgresql 8.4.x and 9.0.
#2b) create a postgres-user named "ideauser" with password "ideapass".
# The easiest way is to use a GUI like pgadmin (http://
#as the postgres user and create the user on the psql-command line:
# $ psql -u postgres
# postgres# CREATE USER ideauser PASSWORD 'ideapass'
su postgres
psql
# CREATE USER ideauser PASSWORD 'ideapass'
#2c) create a database "tdf" with "ideauser" as owner
# Again, use pgadmin to do this, or via psql:
# postgres# CREATE DATABASE tdf OWNER ideauser
#CREATE DATABASE tdf OWNER ideauser
# Editar /etc/postgresql/9.1/main/pg_hba.conf cambiando:
#local all all peer
#por:
#local all all md5
#2d) create the initial database-structure.
# Load the file /path/to/tdf/datafeeder/resources/sql/DDL/postgresql/
#create_tables.sql into the database. On a linux command line, this can
#be done like this:
psql tdf ideauser < /path/to/tdf/datafeeder/resources/sql/DDL/postgresql/create_tables.sql
# It shows 4 warnings at the end which I ignored (I think the script
# assumes to be imported as the postgres user, and not as ideauser)
# 2e) log in to psql, either on the command line or using pgadmin, and
# modify the search-path for the ideauser as specified.
psql tdf ideauser
# postgres$ ALTER USER ideauser SET search_path TO idea, pg_catalog;
# 2f) edit the file /path/to/tdf/datafeeder/resources/sql/alter/postgresql/r27_shapes.sql:
# the tablename user must be quoted: user -> "user" (2x)
# so, the ends on line 5 and line 26:
# REFERENCES user(user_id);
# should become
# REFERENCES "user"(user_id);
# 2g) load the modified sql-script into the database (similar to 2d)
psql tdf ideauser < /path/to/tdf/datafeeder/resources/sql/alter/postgresql/r27_shapes.sql
# It will show 2 errors at the beginning, ignore them.
# 2h) load the next sql-script into the database.
psql tdf ideauser < /path/to/tdf/datafeeder/resources/sql/alter/postgresql/r27_transfers.sql
# 2i) edit the file /path/to/tdf/datafeeder/resources/sql/alter/postgresql/r28_users.sql:
# the tablename user must be quoted: user -> "user" (three times,
# similar to 2f)
# 2j) load the modified file
psql tdf ideauser < /path/to/tdf/datafeeder/resources/sql/alter/postgresql/r28_users.sql
# 2k) load all of the remaining sql-files in /path/to/tdf/datafeeder/resources/sql/alter/postgresql/, one after the other. The don't have to be edited.
# 2l) edit /path/to/tdf/datafeeder/resources/import-test.sql
# replace "CURDATE()" with "current_timestamp"
# 2m) laod the test-data:
psql tdf ideauser < /path/to/tdf/datafeeder/resources/import-test.sql
# 3) compile and install tdf
# ---------------------------------------------------------------------
# 3a) change to the checkout-directory of tdf
cd path/to/tdf
# 3b) create a file "build.properties" in this directory with the following 3 lines as content:
# jboss.domain=default
# profile=prod
# 3c) edit the file resources/datafeeder-prod-ds.xml
# change the database-name from idea-sandbox to tdf
# and set the correct password (i.e. "ideapass" in our example)
# 3d) compile and install/deploy tdf
ant
# download and install the jdbc-driver for postgres.
# download the jar-file matching your postgres installation from
# to/jboss/common/lib/
# 3f) start jboss. This is dependent on you system, how you start JBoss.
# in my installation, it could start it directly
# on Ubuntu and probably other linux distros, it's typically:
/etc/xinit.d/jboss start
# 3g) wait until jboss has completely started, then you should be able
# login as admin, with an empty password
# 3h) change passwords in the web gui. Then create additional users,
# agencies etc and start entering data.
# Some additional notes / experiences:
# - I first tried to deploy/install tdf on JBoss AS 6.0. First, the
# deployment failed due to some problem sounding similar to <https://
# unzip it, and then copy jboss-seam-2.2.1.Final/lib/jboss-seam-ui.jar
# to path/to/tdf/datafeeder/lib/
# With this change, tdf got correctly deployed ($ ant clean; ant) and
# loaded by JBoss, but the tdf-GUI did not work properly, likely due to
# other incompabilities, resulting in strange error messages and data
# not being able to be saved. Thus, one has to use JBoss 5.1 for tdf r6.
# - The installation could be simplified if e.g. all the sql-files would
# be updated to work with postgresql 8.4 and newer (e.g. steps 2f, 2i
# and 2l could be done once in the repository). Also, the installation
# process would be simplified if the many single sql-updates (steps 2f -
# 2k) could be merged into one file.
# - In addition, the sql-updates assume that a tablespace/schema "idea"
# is used, making step 2e necessary. By cleaning up the sql-files, this
# step could probably also be omitted.
# - The warnings produced in step 2d are due to sql-commandos only
# available to the postgresql super-user, but (as far as I understand
# them) not even necessary for the correct working of tdf. So they could
# be removed as well.
# - Despite its length, this documentation may be far from complete.
# Especially the parts involving postgresql assume you have a properly
# configured and working postgresql-installation. Thus, instructions
# involving postgresql are rather short, as these notes focus more on
# getting tdf itself installed. Depending on your actual installation,
# you might need some additional documentation on how to do some things
# in postgresql on your system.