Manual postgres setup in linux

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

IMPORTANT: New information released by Tony Snook about security releases.


Here is precompiled pljava for postgresql 8.2 http://84.34.147.89/pljava.zip

For postgresql 8.1, http://pgfoundry.org/frs/download.php/967/pljava-i686-pc-linux-gnu-pg8.1-1.3.0.tar.gz


#! /bin/bash

#Author: Timo Kontro kontro@users.sourceforge.net
#Victor Pèrez's install.sh script from ADempiere311-PG-linux.jar has been
# a valuable reference.

#If you want easy way installing adempiere on linux check out:
#http://www.adempiere.com/wiki/index.php/ADempiere_Install

#But if you want install Adempiere's database using distributions own 
#Postgresql package this file might help you.

#In this document I am using Debian Unstable, Postgresql 8.2 and Adempiere3.1.2.
#Allthough this works as a script I really don't recomend executing this.
#Since there is no errorchecking of anykind.

#You will need at least postgresql and javasdk installed. Also make sure that
#$JAVA_HOME environmental variable is set.
#You should also download Adempiere312.tar.gz and 
#compile pljava from source (no binary version for Postgresql8.2).
#Adempiere can be downloaded from here:
#https://sourceforge.net/project/showfiles.php?group_id=176962
#And pljava is here: http://pgfoundry.org/frs/?group_id=1000038
# Ok lets begin (with root rights).

#Change these variables if needed
POSTGRES_CONF=/etc/postgresql/8.2/main/postgresql.conf
ADEMPIERE_PACKAGE=/tmp/Adempiere312.tar.gz
#
#Unpacking
cd /opt
#Copy here compiled pljava.so and pljava.jar
mkdir pljava 
tar -xzf $ADEMPIERE_PACKAGE -C /opt
unzip -d /tmp /opt/Adempiere/data/Adempiere_pg.jar

#Lets modify postgres's configuration files.
#This does not work if there is already values in dynamic_library_path
#or custom_variable_classes.

echo "dynamic_library_path = '\$libdir:/opt/pljava'" >> $POSTGRES_CONF
echo "custom_variable_classes = 'pljava'" >> $POSTGRES_CONF
echo "pljava.classpath = '/opt/pljava/pljava.jar'" >> $POSTGRES_CONF

#Then we tell Linux where to find java vm libraries when postgres
#needs them.
echo '$JAVA_HOME/jre/lib/i386' >> /etc/ld.so.conf
echo '$JAVA_HOME/jre/lib/i386/client' >> /etc/ld.so.conf
echo '$JAVA_HOME/jre/lib/i386/native_threads' >> /etc/ld.so.conf

#Tell postgres and runtime linker to read new configurations.
ldconfig
/etc/init.d/postgresql-8.2 restart

su postgres
#This will ask password for new database user.
createuser -P -E -d adempiere
createdb -E UTF8 -O adempiere adempiere

#Installing database dump
psql -d adempiere < /tmp/Adempiere_pg.dmp

exit

#Thats it. If adempiere server cannot connect database
#check pg_hba.conf and postgresql.conf's listen_addresses variable.

kontro 16:33, 3 January 2007 (EST)