Difference between revisions of "Adempiere/Libero Linux install from subversion head"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(Installation Steps to bring up Adempiere/Libero on Linux)
(Added Category)
 
(112 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Installation Steps to bring up Adempiere/Libero on Linux =
+
=Foreward=
  
  1.  change to root
+
This is an attempt to correct and clarify documentation posted by a fellow employee, and update the [[Debian and PostgreSQL Install]] wiki to lenny as I use it. Where the old one works I will post the functional text without specific attribution. All text within may be assumed to be from the [[Debian and PostgreSQL Install]], my fellow employee, myself, or wild-eyed greylings (whatever you wish) except where expressly noted otherwise.  
  2.  svn co https://adempiere.svn.sourceforge.net/svnroot/adempiere/trunk/adempiere adempiere
+
  3.  cd adempiere
+
  4.  svn co https://adempiere.svn.sourceforge.net/svnroot/branches/libero libero
+
  4.5.  cd ../../
+
  5.  cvs -d :pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pljava login  (password is anonymous)
+
  6.  cvs -d :pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pljava co org.postgresql.pljava
+
  7.  cd org.postgresql.pljava/
+
  8.  make
+
  9.  make install
+
  10.  download postgresql-8.2-504.jdbc2.jar (from somewhere)
+
  11.  export CLASSPATH=/root/org.postgresql.pljava/build/deploy.jar:/root/postgresql-8.2-504.jdbc2.jar:/root/org.postgresql.pljava/build/test.jar
+
  12.  download and install jdk-1_5.x-linux-i586.bin
+
  13.  install postgres 8.2.3 or later
+
  14.  modify the pg_hba.conf of your postgres installation to allow for connections correctly
+
  15. modify the postresql.conf listen_addresses = to be the right ip address
+
  16.  modify the postgresql.conf to have the right pljava entries
+
  17.  startup postgres
+
  18.  createuser adempiere (answer yes to all)
+
  19.  createdb adempiere --encoding=unicode
+
  20.  psql adempiere
+
  21.  alter user adempiere with password 'adempiere';
+
  22.  \q
+
  22.1  change to root (su - )
+
  22.2  java org.postgresql/pljava.deploy.Deployer -install -user
+
  adempiere -password adempiere -host 172.16.1.43 -database adempiere
+
  (use your ip address)
+
  22.2  change back to postgres (su - postgres)
+
  23.  jar -xf adempiere/data/seed/Adempiere_pg.jar
+
  24.  psql adempiere < Adempiere_pg.dmp
+
  25.  psql adempiere
+
  26.  select sqlj.install_jar('file:/var/lib/pgsql/sqlj.jar','sqlj',true);
+
  27.  SELECT sqlj.set_classpath('adempiere', 'sqlj');
+
  28.  SET search_path TO adempiere,public;
+
  29.  select bpartnerRemitLocation (118);
+
        is for testing it must return 120, if it returns ok installation of
+
        db is completed before 1 and 2 you must drop user and/or database if
+
        created for 26, you must change the path of sql.jar
+
  29.1  apply all patch sql scripts from adempiere/migration/330-trunk/postgresql to the adempeire database
+
  
  30. change back to root su -  
+
This document also assumes you are using Debian release Lenny. This is being tested against vservers, some information may not be needed in a non-vserver install. If you verify this data, please add a line at the end of this section with this format:
  31. cd adempiere/utils_dev
+
<pre>
  32. export ADEMPIERE_HOME= /root/work2/adempiere/adempiere/Adempiere
+
'''Verified:''' distro version (kernel)
        (or something like it)  
+
<br/>'''''notes:''''' special notes
  33.  ./RUN_build.sh
+
<br/>~~~~username
  34.  cd $ADEMPIERE_HOME
+
<hr/>
  35. sh RUN_setup.sh (Remember to choose postgres database and put in
+
</pre>
        the right ip addresses for the server/database and also the right
+
e.g.
        username/passsword for the database
+
<hr/>
  36.  cd utils
+
'''Verified:''' InsanoFlex 0.1 (linux 2.6.23-blackmagic kernel)
  37nohup ./RUN_Server2.sh &
+
<br/>'''''notes:''''' needed to do voodoo dance and sacrifice 3 chickens to account for blackmagic voodoo userspace limitations
  38.  cd ..
+
<br/>[[User:JD|JD]] 13:19, 24 October 2007 (EDT)JD
  39cp libero/2pack/EE01.zip $ADEMPIERE_HOME/packages
+
<hr/>
  40. ./RUN_Adempiere.sh
+
 
  41. import EE01.zip 2pack
+
'''Don't expect this to work right now, I'm documenting it as I install it. This warning will be removed as my work is completed and I will add my own Verified line'''
  42. setup a new client
+
 
  43cd adempiere/libero
+
=Initial Application Server setup =
   44cp ../lib/libero.jar ../adempiere/Adempiere/packages/packages/EE01/lib/libero.jar
+
We're starting off on the application server. Some of this is needed before we can set up the database, but the database is needed before we can start the application, so we'll go back and forth a little bit.
  46cd adempiere/utils_dev
+
 
  47stop both client and server
+
We're going to use /usr/local/src/ to store all our source code, if this dir doesn't exist you'll want to create it. The rest of this doc assumes this dir for all source, so if you use a different one you'll have to change some things. Now we create the adempiere and libero dirs in the /usr/local/src dir:
  48.  ./RUN_build.sh
+
mkdir -p /usr/local/src/{adempiere,libero}
  49.  cd $ADEMPIERE_HOME
+
 
  50.  ./RUN_silentsetup.sh
+
If you don't have svn, ant, and a jdk installed you'll need to get them (if you want to use ant to populate the database you'll also need postgresql-client on the app server):
  51Add a new form for the Libero BOM Drop in the Application Dictionary under the manufacturing menu
+
aptitude install subversion sun-java5-jdk ant postgresql-client-8.2
 +
*You may need to add non-free and contrib to the end of one of your sources lines in /etc/apt/sources.list then aptitude update and try again:
 +
sed -i 's/\(deb .*\)/\1 non-free contrib/' /etc/apt/sources.list
 +
aptitude update
 +
aptitude install sun-java5-jdk
 +
 
 +
Next use svn to checkout from the adempiere repository:
 +
svn checkout https://adempiere.svn.sourceforge.net/svnroot/adempiere/trunk /usr/local/src/adempiere
 +
Now do the same for libero:
 +
  svn checkout  https://adempiere.svn.sourceforge.net/svnroot/adempiere/branches/libero  /usr/local/src/adempiere/libero
 +
 
 +
We need to build this in order to have the sqlj.jar file for the database server. Lets make an adempiere directory and build it:
 +
mkdir /usr/local/adempiere
 +
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
 +
  cd /usr/local/src/adempiere/utils_dev/
 +
  ant complete
 +
 
 +
This will create a tar.gz file inside adempiere/install, extract this to /usr/local, and make all the shell scripts executable
 +
tar zxvf /usr/local/src/adempiere/adempiere/install/Adempiere_330.tar.gz -C /usr/local
 +
find /usr/local/Adempiere -iname '*.sh' -exec chmod u+x '{}' \;
 +
 
 +
Extract the the seed for the database and copy it over to the database server. At the same time we'll copy over the sqlj.jar. Because we use vservers we didn't need to use scp, but you probably will.
 +
scp /usr/local/src/adempiere/sqlj/sqlj.jar /usr/local/Adempiere/data/Adempiere_pg.dmp <db server>:<where-ever you want it>
 +
 
 +
 
 +
Now set up the database server
 +
 
 +
=Database Server=
 +
 
 +
Install postgres and development files
 +
aptitude install postgresql-server-dev-8.2 postgresql-8.2 cvs
 +
 
 +
* If your config files don't get installed you may need to change some of your locales and rebuild your database:
 +
export LC_ALL="POSIX"
 +
export LANG="POSIX"
 +
pg_createcluster 8.2 main
 +
* If you're using a vserver you should probably to change the listen address in postgresql.conf to your external ip address since localhost may not be a usable address, especially if you have another postgres vserver.
 +
 
 +
install sun java5 jdk
 +
<code><pre>aptitude install sun-java5-jdk</pre></code>
 +
*This may require you to add contrib and non-free to your /etc/apt/sources.list (see above)
 +
 
 +
Get jdbc for your current java from [http://jdbc.postgresql.org/download.html here], we put it in /usr/local/lib. Remember the dir as it will be used later.
 +
cd /usr/local/lib
 +
wget http://jdbc.postgresql.org/download/postgresql-8.2-506.jdbc3.jar
 +
 
 +
return to your compile dir, we used /usr/local/src so as not to make a mess
 +
  cd /usr/local/src
 +
 
 +
Get pljava from cvs:
 +
cvs -d :pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pljava login (password is anonymous)
 +
cvs -d :pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pljava checkout org.postgresql.pljava
 +
 
 +
Compile and install (it will automatically install to your postgresql lib dir):
 +
  cd org.postgresql.pljava
 +
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
 +
  make
 +
make install
 +
 
 +
edit the postgresql.conf and add the following lines
 +
<code><pre>custom_variable_classes = 'pljava'             
 +
# define the class path that the JVM will use when loading the
 +
# initial library. Only meaningful for non GCJ installations 
 +
pljava.classpath='/usr/lib/postgresql/8.2/lib/pljava.jar'
 +
# Set the size of the prepared statement MRU cache
 +
# ... that's server side caching of stuff
 +
# (What are the units on this? Is K, or M, or Ardvarks, or Mass/The speed of light?
 +
# I can't find any docs. Someone please comment)
 +
pljava.statement_cache_size = 10
 +
# If true, lingering savepoints will be released on function exit. If false,
 +
# the will be rolled back
 +
#
 +
pljava.release_lingering_savepoints = true
 +
# Define startup options for the Java VM.
 +
# (sun docs suggest the commented one, this wiki doesn't specify.
 +
# Anyone who's tried different options, input would be helpful. )
 +
#pljava.vmoptions = '-Xmx64M'
 +
pljava.vmoptions = ''
 +
# Setting debug to true will cause the postgres process to go
 +
# into a sleep(1) loop on its first call to java. This variable is
 +
# only useful if you want to debug the PL/Java internal C code.
 +
#
 +
pljava.debug = false
 +
</pre></code>
 +
 
 +
* Much of this is cut and paste from [http://gborg.postgresql.org/project/pljava/genpage.php?userguide postgres] with direction from the old debian wiki.
 +
 
 +
And add the JAVA_HOME environment variable to the environment file:
 +
<code><pre>
 +
JAVA_HOME='/usr/lib/jvm/java-1.5.0-sun'
 +
</pre></code>
 +
Add the application and database servers to your pg_hba.conf
 +
  host        all        all        <application>/32        trust
 +
hostnossl   all        all        <db>/32                md5
 +
host        all        all        <your net & cidr>      md5
 +
 
 +
Restart postgres
 +
  /etc/init.d/postgresql-8.2 restart
 +
 
 +
Now export your CLASSPATH (re-export your JAVA_HOME if you've logged out since the last time) so we can run the next command
 +
  export CLASSPATH='/usr/local/src/org.postgresql.pljava/build/deploy.jar:/usr/local/lib/postgresql-8.2-506.jdbc3.jar'
 +
 
 +
Now we install pljava support in the main cluster with the following:
 +
su postgres -c "export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun;
 +
/usr/bin/psql -d template1 \
 +
-f /usr/local/src/org.postgresql.pljava/src/sql/install.sql"
 +
* If you're using amd64 you'll need to add libjvm to your ld path otherwise you'll get several errors generally ending in 'ERROR:  language "java" does not exist'
 +
echo "$JAVA_HOME/jre/lib/amd64/server/" > /etc/ld.so.conf.d/postrgresql
 +
ldconfig
 +
 
 +
Create a user for Adempiere to run as:
 +
useradd -d /nonexistant -s /usr/bin/psql adempiere
 +
 
 +
create user and database for adempiere:
 +
su postgres -c "createuser adempiere -s -P;
 +
createdb adempiere --encoding=unicode"
 +
* Remember the password you entered for adempiere, you will need it later
 +
 
 +
This prepares the database for pljava (according to wgth, donno if it's really needed or not)
 +
java org.postgresql/pljava.deploy.Deployer -install -user adempiere -password <passwd> -host <db ip> -database adempiere
 +
 
 +
Dump the adempiere seed SQL into the database. This assumes the dmp was moved to root's home.
 +
cat ~/Adempiere_pg.dmp | su postgres -c "psql adempiere"
 +
 
 +
 
 +
I copied over sqlj.jar into root's home, so now I'm going to put it in a more logical location
 +
mv ~/sqlj.jar /var/lib/postgresql/
 +
 
 +
Now install sqlj.jar and test it out
 +
  su - postgres
 +
psql adempiere
 +
from inside postgres:
 +
select sqlj.install_jar('file:/var/lib/postgresql/sqlj.jar','sqlj',true);
 +
SELECT sqlj.set_classpath('adempiere', 'sqlj');
 +
  SET search_path TO adempiere,public;
 +
select bpartnerRemitLocation (118);
 +
If this last command returns 120 you can safely log out as postgres and begin running the migration sql code. We'll do this in the next section.
 +
 
 +
Now we should be able to return to the application server.
 +
 
 +
=Finishing the Application and Database Servers=
 +
 
 +
edit /usr/local/src/adempiere/migration/postgresql.properties:
 +
 
 +
#PostgreSQL home folder                                                                                                                                   
 +
  postgresql.home=/usr
 +
#PostgreSQL pgdata folder                                                                                                                                 
 +
postgresql.pgdata=
 +
#adempeire database name                                                                                                                                 
 +
postgresql.database=adempiere
 +
#adempiere database login                                                                                                                                 
 +
postgresql.user=adempiere
 +
#adempiere database password                                                                                                                             
 +
postgresql.password=<password>
 +
postgresql.host=<db ip>
 +
postgresql.port=5432
 +
 
 +
Finish the db server by running the sql patches, fortunately ant can take care of that for us
 +
  cd /usr/local/src/adempiere/migration/330-trunk/postgresql
 +
ant
 +
 
 +
Now we take the AdempiereEnvTemplate.properties and copy it to AdempiereEnv.properties, then edit it so it matches our environment (most we don't need to change, I'll omit much of that):
 +
 
 +
ADEMPIERE_HOME=/usr/local/Adempiere/
 +
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
 +
#we have a lot of ram, so we're goint to bump this a bit
 +
ADEMPIERE_JAVA_OPTIONS=-Xms512M -Xmx1536M
 +
 +
#Database server host name
 +
ADEMPIERE_DB_SERVER=<db ip>
 +
#Database user password
 +
ADEMPIERE_DB_PASSWORD=<password>
 +
 
 +
#make sure you change this to the ip/hostname
 +
#people will connect to you from,
 +
#not just where it is relative to you
 +
ADEMPIERE_APPS_SERVER=<ip>
 +
 +
#Keystore setting
 +
ADEMPIERE_KEYSTORE=/usr/local/Adempiere/keystore
 +
 
 +
#Certificate details
 +
#Common name, default to host name
 +
ADEMPIERE_CERT_CN=adempiere
 +
#Organization, default to the user name
 +
ADEMPIERE_CERT_ORG=<org>
 +
#Organization Unit, default to 'AdempiereUser'
 +
ADEMPIERE_CERT_ORG_UNIT=AdempiereUser
 +
#town
 +
ADEMPIERE_CERT_LOCATION=<town>
 +
#state
 +
ADEMPIERE_CERT_STATE=<state>
 +
#2 character country code
 +
ADEMPIERE_CERT_COUNTRY=<country>
 +
 
 +
Now we can do a silent install and not have to worry about install any xutils:
 +
  ./RUN_silentsetup.sh
 +
 
 +
Start up the server (you have to go to the dir, because, unfortunately, the util scrips appear to use relative paths).
 +
  cd /usr/local/Adempiere/utils/
 +
nohup ./RUN_Server2.sh&
 +
<br>
 +
todo: write init script for Adempiere.
 +
 
 +
=Adding Libero=
 +
<b>libero is broken right now, this should be removed when it works</b><br>
 +
 
 +
Build libero:
 +
cd /usr/local/src/adempiere/libero
 +
ant
 +
This produces a zip in /usr/local/src/adempiere/libero/2pack. Move this to a system with X on it and run Adempiere. Login as System using the system password supplied in the setup.<br>
 +
<br>
 +
follow the instructions found [http://www.adempiere.com/wiki/index.php/Libero_EE01_Install_Manual#Manual_Info  here]
 +
 
 +
[[Category:Developer documentation]]

Latest revision as of 05:28, 5 January 2008

Foreward

This is an attempt to correct and clarify documentation posted by a fellow employee, and update the Debian and PostgreSQL Install wiki to lenny as I use it. Where the old one works I will post the functional text without specific attribution. All text within may be assumed to be from the Debian and PostgreSQL Install, my fellow employee, myself, or wild-eyed greylings (whatever you wish) except where expressly noted otherwise.

This document also assumes you are using Debian release Lenny. This is being tested against vservers, some information may not be needed in a non-vserver install. If you verify this data, please add a line at the end of this section with this format:

'''Verified:''' distro version (kernel)
<br/>'''''notes:''''' special notes 
<br/>~~~~username
<hr/>

e.g.


Verified: InsanoFlex 0.1 (linux 2.6.23-blackmagic kernel)
notes: needed to do voodoo dance and sacrifice 3 chickens to account for blackmagic voodoo userspace limitations
JD 13:19, 24 October 2007 (EDT)JD


Don't expect this to work right now, I'm documenting it as I install it. This warning will be removed as my work is completed and I will add my own Verified line

Initial Application Server setup

We're starting off on the application server. Some of this is needed before we can set up the database, but the database is needed before we can start the application, so we'll go back and forth a little bit.

We're going to use /usr/local/src/ to store all our source code, if this dir doesn't exist you'll want to create it. The rest of this doc assumes this dir for all source, so if you use a different one you'll have to change some things. Now we create the adempiere and libero dirs in the /usr/local/src dir:

mkdir -p /usr/local/src/{adempiere,libero}

If you don't have svn, ant, and a jdk installed you'll need to get them (if you want to use ant to populate the database you'll also need postgresql-client on the app server):

aptitude install subversion sun-java5-jdk ant postgresql-client-8.2
  • You may need to add non-free and contrib to the end of one of your sources lines in /etc/apt/sources.list then aptitude update and try again:
sed -i 's/\(deb .*\)/\1 non-free contrib/' /etc/apt/sources.list
aptitude update
aptitude install sun-java5-jdk

Next use svn to checkout from the adempiere repository:

svn checkout https://adempiere.svn.sourceforge.net/svnroot/adempiere/trunk /usr/local/src/adempiere

Now do the same for libero:

svn checkout  https://adempiere.svn.sourceforge.net/svnroot/adempiere/branches/libero  /usr/local/src/adempiere/libero

We need to build this in order to have the sqlj.jar file for the database server. Lets make an adempiere directory and build it:

mkdir /usr/local/adempiere
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
cd /usr/local/src/adempiere/utils_dev/
ant complete

This will create a tar.gz file inside adempiere/install, extract this to /usr/local, and make all the shell scripts executable

tar zxvf /usr/local/src/adempiere/adempiere/install/Adempiere_330.tar.gz -C /usr/local
find /usr/local/Adempiere -iname '*.sh' -exec chmod u+x '{}' \; 

Extract the the seed for the database and copy it over to the database server. At the same time we'll copy over the sqlj.jar. Because we use vservers we didn't need to use scp, but you probably will.

scp /usr/local/src/adempiere/sqlj/sqlj.jar /usr/local/Adempiere/data/Adempiere_pg.dmp <db server>:<where-ever you want it>


Now set up the database server

Database Server

Install postgres and development files

aptitude install postgresql-server-dev-8.2 postgresql-8.2 cvs
  • If your config files don't get installed you may need to change some of your locales and rebuild your database:
export LC_ALL="POSIX"
export LANG="POSIX"
pg_createcluster 8.2 main
  • If you're using a vserver you should probably to change the listen address in postgresql.conf to your external ip address since localhost may not be a usable address, especially if you have another postgres vserver.

install sun java5 jdk

aptitude install sun-java5-jdk
  • This may require you to add contrib and non-free to your /etc/apt/sources.list (see above)

Get jdbc for your current java from here, we put it in /usr/local/lib. Remember the dir as it will be used later.

cd /usr/local/lib
wget http://jdbc.postgresql.org/download/postgresql-8.2-506.jdbc3.jar

return to your compile dir, we used /usr/local/src so as not to make a mess

cd /usr/local/src

Get pljava from cvs:

cvs -d :pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pljava login  (password is anonymous)
cvs -d :pserver:anonymous@gborg.postgresql.org:/usr/local/cvsroot/pljava checkout org.postgresql.pljava

Compile and install (it will automatically install to your postgresql lib dir):

cd org.postgresql.pljava
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
make
make install

edit the postgresql.conf and add the following lines

custom_variable_classes = 'pljava'               
# define the class path that the JVM will use when loading the
# initial library. Only meaningful for non GCJ installations  
pljava.classpath='/usr/lib/postgresql/8.2/lib/pljava.jar'
# Set the size of the prepared statement MRU cache
# ... that's server side caching of stuff
# (What are the units on this? Is K, or M, or Ardvarks, or Mass/The speed of light? 
# I can't find any docs. Someone please comment)
pljava.statement_cache_size = 10
# If true, lingering savepoints will be released on function exit. If false,
# the will be rolled back
#
pljava.release_lingering_savepoints = true
# Define startup options for the Java VM.
# (sun docs suggest the commented one, this wiki doesn't specify. 
# Anyone who's tried different options, input would be helpful. )
#pljava.vmoptions = '-Xmx64M'
pljava.vmoptions = ''
# Setting debug to true will cause the postgres process to go
# into a sleep(1) loop on its first call to java. This variable is
# only useful if you want to debug the PL/Java internal C code.
#
pljava.debug = false
  • Much of this is cut and paste from postgres with direction from the old debian wiki.

And add the JAVA_HOME environment variable to the environment file:

JAVA_HOME='/usr/lib/jvm/java-1.5.0-sun'

Add the application and database servers to your pg_hba.conf

host         all         all         <application>/32        trust
hostnossl    all         all         <db>/32                 md5
host         all         all         <your net & cidr>       md5

Restart postgres

 /etc/init.d/postgresql-8.2 restart

Now export your CLASSPATH (re-export your JAVA_HOME if you've logged out since the last time) so we can run the next command

export CLASSPATH='/usr/local/src/org.postgresql.pljava/build/deploy.jar:/usr/local/lib/postgresql-8.2-506.jdbc3.jar'

Now we install pljava support in the main cluster with the following:

su postgres -c "export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun; 
/usr/bin/psql -d template1 \
-f /usr/local/src/org.postgresql.pljava/src/sql/install.sql"
  • If you're using amd64 you'll need to add libjvm to your ld path otherwise you'll get several errors generally ending in 'ERROR: language "java" does not exist'
echo "$JAVA_HOME/jre/lib/amd64/server/" > /etc/ld.so.conf.d/postrgresql
ldconfig

Create a user for Adempiere to run as:

useradd -d /nonexistant -s /usr/bin/psql adempiere

create user and database for adempiere:

su postgres -c "createuser adempiere -s -P;
createdb adempiere --encoding=unicode"
  • Remember the password you entered for adempiere, you will need it later

This prepares the database for pljava (according to wgth, donno if it's really needed or not)

java org.postgresql/pljava.deploy.Deployer -install -user adempiere -password <passwd> -host <db ip> -database adempiere

Dump the adempiere seed SQL into the database. This assumes the dmp was moved to root's home.

cat ~/Adempiere_pg.dmp | su postgres -c "psql adempiere"


I copied over sqlj.jar into root's home, so now I'm going to put it in a more logical location

mv ~/sqlj.jar /var/lib/postgresql/

Now install sqlj.jar and test it out

su - postgres 
psql adempiere

from inside postgres:

select sqlj.install_jar('file:/var/lib/postgresql/sqlj.jar','sqlj',true); 
SELECT sqlj.set_classpath('adempiere', 'sqlj');
SET search_path TO adempiere,public;
select bpartnerRemitLocation (118);

If this last command returns 120 you can safely log out as postgres and begin running the migration sql code. We'll do this in the next section.

Now we should be able to return to the application server.

Finishing the Application and Database Servers

edit /usr/local/src/adempiere/migration/postgresql.properties:

#PostgreSQL home folder                                                                                                                                    
postgresql.home=/usr
#PostgreSQL pgdata folder                                                                                                                                  
postgresql.pgdata=
#adempeire database name                                                                                                                                   
postgresql.database=adempiere
#adempiere database login                                                                                                                                  
postgresql.user=adempiere
#adempiere database password                                                                                                                               
postgresql.password=<password>
postgresql.host=<db ip>
postgresql.port=5432

Finish the db server by running the sql patches, fortunately ant can take care of that for us

cd /usr/local/src/adempiere/migration/330-trunk/postgresql
ant

Now we take the AdempiereEnvTemplate.properties and copy it to AdempiereEnv.properties, then edit it so it matches our environment (most we don't need to change, I'll omit much of that):

ADEMPIERE_HOME=/usr/local/Adempiere/
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
#we have a lot of ram, so we're goint to bump this a bit
ADEMPIERE_JAVA_OPTIONS=-Xms512M -Xmx1536M

#Database server host name
ADEMPIERE_DB_SERVER=<db ip>
#Database user password
ADEMPIERE_DB_PASSWORD=<password>
#make sure you change this to the ip/hostname
#people will connect to you from, 
#not just where it is relative to you
ADEMPIERE_APPS_SERVER=<ip> 

#Keystore setting
ADEMPIERE_KEYSTORE=/usr/local/Adempiere/keystore
#Certificate details
#Common name, default to host name
ADEMPIERE_CERT_CN=adempiere
#Organization, default to the user name
ADEMPIERE_CERT_ORG=<org>
#Organization Unit, default to 'AdempiereUser'
ADEMPIERE_CERT_ORG_UNIT=AdempiereUser
#town
ADEMPIERE_CERT_LOCATION=<town>
#state
ADEMPIERE_CERT_STATE=<state>
#2 character country code
ADEMPIERE_CERT_COUNTRY=<country>

Now we can do a silent install and not have to worry about install any xutils:

./RUN_silentsetup.sh

Start up the server (you have to go to the dir, because, unfortunately, the util scrips appear to use relative paths).

cd /usr/local/Adempiere/utils/

nohup ./RUN_Server2.sh&
todo: write init script for Adempiere.

Adding Libero

libero is broken right now, this should be removed when it works

Build libero:

cd /usr/local/src/adempiere/libero
ant

This produces a zip in /usr/local/src/adempiere/libero/2pack. Move this to a system with X on it and run Adempiere. Login as System using the system password supplied in the setup.

follow the instructions found here