PostgreSQL Installation Notes
Daisy Installation - PostgreSQL
Thanks to Olivier Lange for
http://lists.cocoondev.org/pipermail/daisy/2005-January/000740.html
Instructions also purloined from:
- http://news.gmane.org/gmane.comp.java.openjms.user 31 May 2005 16:22 Tim Anderson
- http://lists.cocoondev.org/pipermail/daisy/2004-December/000557.html
Note that these instructions are almost exactly the same as the standard
README instructions - I
was working from the ones in the distro.
If these instructions cause your system to be consumed in a ball of fire, you're
on your own matey.
Environment
- Daisy 1.3 M3 src
- PostgreSQL 7.4.7
- Gentoo Linux 2005.0
- Sun JDK 1.4.2_b07
1. Create databases and users:
$ psql -U postgres template1
CREATE USER openjms WITH PASSWORD 'openjms' CREATEDB CREATEUSER;
CREATE USER daisy WITH PASSWORD 'daisy' CREATEDB CREATEUSER;
$ psql -U openjms template1
CREATE DATABASE openjms WITH ENCODING = 'utf8';
$ psql -U daisy template1
CREATE DATABASE daisyrepository WITH ENCODING = 'utf8';
2. Get Maven
Stable: currently 1.02
Unpack, export MAVEN_HOME, PATH=$MAVEN_HOME/bin:$PATH
$ ln -s {wherever}/xalan.jar $MAVEN_HOME/lib/endorsed/
3. Get Merlin
Stable: currently 3.3.0
Unpack, export MERLIN_HOME, PATH=$MERLIN_HOME/bin:$PATH
4. Add Merlin plugins to Maven:
$ ln -s $MERLIN_HOME/plugins/avalon-meta/plugins/avalon-meta-plugin-1.4.0.jar $MAVEN_HOME/plugins/
$ ln -s $MERLIN_HOME/plugins/avalon-util/plugins/avalon-util-plugin-1.0.0.jar $MAVEN_HOME/plugins/
$ ln -s $MERLIN_HOME/plugins/merlin/plugins/merlin-plugin-3.3.0.jar $MAVEN_HOME/plugins/
5. Get Torque plugin:
$ cd $MAVEN_HOME
$ maven plugin:download -DartifactId=maven-torque-plugin -DgroupId=torque -Dversion=3.1.1
# // Creates ~/.maven, downloads relevant jars.
6. Get OpenJMS
Stable: 0.7.6.1
Unpack, export OPENJMS_HOME
8. Add PostgreSQL JDBC3 driver to OpenJMS
$ ln -s {pgsql-whatever.jar} OPENJMS_HOME/lib/
9. Edit OPENJMS_HOME/bin/setenv.sh
# Specify postgresql driver jar as CLASSPATH
# While we're at it - set JAVA_OPTS=-Xmx256m
10. Edit OPENJMS_HOME/config/openjms.xml as per Daisy README.txt but with PostgreSQL settings:
- in <DatabaseConfiguration> use README.txt settings but change
driver="org.postgresql.Driver"
url="jdbc:postgresql://localhost/openjms"
11. Create DB: this must apparently be done manually:
$ psql -U openjms openjms < $OPENJMS_HOME/config/db/create_postgresql.sql
# See http://news.gmane.org/gmane.comp.java.openjms.user 31 May 2005 16:22 Tim Anderson
# This step replaces the instruction in daisy/README.txt:
# DO NOT DO THIS: $ ./dbtool.sh -create -config $OPENJMS_HOME/config/openjms.xml
12. Start OpenJMS: OPENJMS_HOME/bin/startup.sh
13. Create and edit {daisy}/repository/server/myconfig.xml as per README.txt
with database settings:
<target path="/daisy/datasource/datasource">
<configuration>
<username>daisy</username>
<password>daisy</password>
<url>jdbc:postgresql://localhost/daisyrepository</url>
<!-- driver class path can contain a comma-separated list of paths to jars. -->
<driverClasspath>###/path/to/postgresql/pg74.216.jdbc3.jar</driverClasspath>
<driverClassName>org.postgresql.Driver</driverClassName>
<!--
<connectionProperties>
<property name="..." value="..."/>
</connectionProperties>
-->
<maxActive>20</maxActive>
<maxIdle>8</maxIdle>
<minIdle>0</minIdle>
<maxWait>5000</maxWait>
</configuration>
</target>
Note: make sure the blobstore and indexstore directories exist and are writable by the user running Daisy.
14. Edit {daisy-src}/install/src/java/org/outerj/daisy/install/InstallHelper.java -
in the static initializer block for ALL_DATABASES uncomment the PostgreSQL code, setting
the path to appropriate JDBC driver. This path is relative to
~/.maven/repository
Setting an absolute path such as /path/to/jdbc-driver.jar causes problems.
Recompile with:
$ cd {daisy-src}
$ maven
15. Init DB as per {daisy-src}/README.txt
-- but, as per README:
* when you reach the "drop database" question, answer yes.
* when asked to create a daisy data directory, answer no.
^^
If you foul it up:
$ psql -U daisy template1
DROP DATABASE daisyrepository;
CREATE DATABASE daisyrepository WITH ENCODING = 'utf8';
then re-run
$ ./daisy-repository-init-dev --advanced
From here on, follow the docs.
Note: if you change the 'registrar' user from the 'defaultpwd' setting in the config file,
you'll find it in {daisy-src}applications/daisywiki/frontend/target/cocoon/webapp/WEB-INF/cocoon.xconf



There are no comments.