Thursday, December 08, 2005

FC4:Compiere Libero make Postgresql

I. Instalasi Server Compiere
1. Install Java2 SDK yang 1.4.2 (gunakan versi ini dan jangan ngeyel!)
# rpm -Uvh j2sdk_1_4_2_04-linux-i586.rpm

2. Buat file /etc/profile.d/jdk.sh yang isinya
#!/bin/sh
#
export PATH="/usr/java/j2sdk1.4.2_04/bin/:$PATH"
export CLASSPATH="/usr/java/j2sdk1.4.2_04/lib/:/usr/java/j2sdk1.4.2_04/include/:."

3. Install Postgresql (bawaan dari CD distro FC4)
catatan : pilih juga paket postgresql-jdbc, selain paket default untuk postgresql
catatan : setelah instalasi, jalankan server kemudian matikan supaya file konfigurasi default terbentuk

4. Edit isi /var/lib/pgsql/data/pg_hba.conf menjadi
local all all trust
host all all 0.0.0.0/0 trust

5. Edit isi /var/lib/pgsql/data/postgresql.conf
listen_addresses = '*'
dynamic_library_path = '/opt/app/pgsql/pljava'
custom_variable_classes = 'pljava'
pljava.classpath= '/opt/app/pgsql/pljava/pljava.jar'
pljava.release_lingering_savepoints = true
pljava.vmoptions='-Xmx64M -Dbackchannel.port=48'
pljava.debug=false

6. Ekstraksi pljava ke /opt/app/pgsql/pljava
# mkdir -p /opt/app/pgsql/pljava
# cp pljava-i686-pc-linux-gnu-pg8.0-1.2.0.tar.gz /opt/app/pgsql/pljava
# cd /opt/app/pgsql/pljava
# tar zxvf pljava-i686-pc-linux-gnu-pg8.0-1.2.0.tar.gz

7. Buat file /etc/profile.d/compiere.sh yang isinya
#!/bin/sh
#
export COMPIERE_HOME=/opt/app/Compiere2
export PATH = /opt/app/Compiere2/bin:$PATH
export LD_LIBRARY_PATH = JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client:$LD_LIBRARY_PATH

8. Ekstrak Compiere_252.tar.gz ke /opt/app/
# cp Compiere_252.tar.gz /opt/app
# cd /opt/app
# tar zxvf Compiere_252.tar.gz

9. Jalankan postgresql
# /etc/init.d/postgresql start

10. Siapkan user dan database di postrgesql
# su - postgres
$ createlang plpgsql template1
$ createuser compiere
$ createdb compiere -e unicode

11. Instalasi pljava ke database
# java -cp /opt/app/pgsql/pljava/deploy.jar:/usr/share/java/postgresql-8.0-311.jdbc3.jar org.postgresql.pljava.deploy.Deployer -install -user compiere -database compiere
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U compiere -d compiere
compiere=# CREATE SCHEMA compiere;
compiere=# SET search_path TO compiere,sqlj;
compiere=# SELECT sqlj.install_jar('file:///opt/app/Compiere2/lib/sqlj.jar','sqlj', true);
compiere=# SELECT sqlj.set_classpath('compiere','sqlj');
compiere=# \q

12. Instalasi compiere
# cd /opt/app/Compiere2
# sh RUN_setup.sh
# psql -U compiere -d compiere < $COMPIERE_HOME/data/CompierePGSQL.dmp

13. Jalankan server compiere
# cd /opt/app/Compiere2
# sh utils/RUN_Server2.sh

14. Jalankan client compiere
# cd /opt/app/Compiere2
# sh RUN_Compiere2.sh

II. Instalasi Client Compiere
1. Browse ke server Compiere
2. Download paket Compiere2Client.zip dari server Compiere
3. Ekstraksi Compiere2Client.zip
$ unzip Compiere2Client.zip

4. Jalankan client compiere
$ cd Compiere2
$ sh RUN_Compiere2.sh