Install on Ubuntu 8.10

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

Document created: by Magyusz on 19 Feb 2008 as an update of Install_on_Ubuntu_8.04

(I think this is extremely important when documenting something that is likely to change within a year or so)

This document has a lot of common with Debian_and_PostgreSQL_Install as Ubuntu and Debian have a lot of common too :)

Common problems and their solution is described here: InstallServer

Let's assume you have Ubuntu 8.10 installed (64 bit for now).

sudo apt-get install sun-java6-jdk postgresql-8.3 postgresql-server-dev-8.3

This will most likely install some other packages as well (enter root password for sudo, say yes).

Let's check this:

> dpkg -l|grep postgres
ii  postgresql-8.3                             8.3.6-0ubuntu8.10                       object-relational SQL database, version 8.3 
ii  postgresql-client-8.3                      8.3.6-0ubuntu8.10                       front-end programs for PostgreSQL 8.3
ii  postgresql-client-common                   90                                      manager for multiple PostgreSQL client versi
ii  postgresql-common                          90                                      PostgreSQL database-cluster manager
ii  postgresql-server-dev-8.3                  8.3.6-0ubuntu8.10                       development files for PostgreSQL 8.3 server-

> dpkg -l|grep java
ii  java-common                                0.30ubuntu3                             Base of all Java packages
ii  sun-java6-bin                              6-10-0ubuntu2                           Sun Java(TM) Runtime Environment (JRE) 6 (ar
ii  sun-java6-jdk                              6-10-0ubuntu2                           Sun Java(TM) Development Kit (JDK) 6
ii  sun-java6-jre                              6-10-0ubuntu2                           Sun Java(TM) Runtime Environment (JRE) 6 (ar

Okay, now something harder:

cd /tmp
wget http://pgfoundry.org/frs/download.php/1585/pljava-src-1.4.0.tar.gz 
tar zxf pljava-src-1.4.0.tar.gz 
cd pljava-1.4.0/
make

Hm, this will give us a lot of errors. We need jdk-5 to do the compile.

sudo apt-get install sun-java5-jdk

Java 5 is installed as well. Now test which java is used?

java -version

Not good, Java6 is still used.

sudo update-alternatives --config javac

Now choose Java 5.

sudo update-alternatives --config java

Now choose Java 5 again.

Test again:

java -version

Hah! Java 5 is used. Good! Go back and retry:

cd pljava-1.4.0/
make

Almost okay, complaining about JAVA_HOME Now set JAVA_HOME:

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

Try again:

make

Oh yeah, compiling! (Ok, sorry, I've assumed you have gcc,make and maybe some other packages already installed). Complete package list: Ubuntu804PackageList

Under directory build you have pljava.jar, deploy.jar, examples.jar

Now let's install pljava libraries!

If you'd like other computers to reach your services:

sudo nano /etc/hosts 

and change the entry of your machine name (erpdev.ilogic.int in my case) to something like this:

192.168.1.21	erpdev.ilogic.int erpdev

Linker settings

Check your platform:

find /usr/lib/jvm/java-1.5.0-sun/jre/lib -type d

Yous should see: /usr/lib/jvm/java-1.5.0-sun/jre/lib/amd64 /Note that for other platforms amd64 will be different (eg. i386)!/

sudo nano /etc/ld.so.conf.d/jvm.conf and add the following (if you have amd64): 
/usr/lib/jvm/java-1.5.0-sun/jre/lib/amd64
/usr/lib/jvm/java-1.5.0-sun/jre/lib/amd64/server
/usr/lib/jvm/java-1.5.0-sun/jre/lib/amd64/native_threads
sudo ldconfig
sudo ldconfig -v|grep jvm

If you see libjvm, then it's all right. Don't bother about lib64 ... :)

sudo su - 

You are root from now, so take care!

export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
cd /tmp/pljava-1.4.0/
make install

Edit PostgreSQL configuration:

nano /etc/postgresql/8.3/main/postgresql.conf and add at the end:
custom_variable_classes = 'pljava'
pljava.classpath='/usr/lib/postgresql/8.3/lib/pljava.jar'
pljava.statement_cache_size = 10
pljava.release_lingering_savepoints = true
pljava.vmoptions = ' '
pljava.debug = false

Look for "listen_addresses". Change to:

listen_addresses = '*'          # what IP address(es) to listen on;

If you would like to speed up database performance, you may search in this file for the word fsync, and change it to off (do not forget to uncomment, default is on). This is not recommended for production use, change it back later!

Edit /etc/postgresql/8.3/main/environment and add at the end:

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

Edit /etc/postgresql/8.3/main/pg_hba.conf and add at the end:

local   all         postgres                            md5 
local   all         adempiere                           md5 
host    all         postgres    192.168.111.0/24        md5
host    all         adempiere   192.168.111.0/24        md5

Replace the given IP and netmask with your own.

Restart postgresql:

/etc/init.d/postgresql-8.3 restart

Now you should exit from the root shell:

exit

Now let's install the SQL parts into the database. Please note that you have to install PLJava's SQL part into every database where you would like to use it! Of course if you install it into template1 then every database what you create afterwards will contain PLJava as well.

Become postgres user and then run psql

sudo su - postgres
cd /tmp/pljava-1.4.0/src/sql
psql
alter user postgres unencrypted password 'postgres';

We are in psql, now connect to template1:

\c template1 

Now run install :

\i install.sql

You will see some NOTICE:s, that's normal.

(Alternatively you can use the provided deploy.jar, although then you will have to copy the PostgreSQL JDBC driver into build directory.)

You can check if the schema was created by:

\dn 

in psql. If sqlj is there, then you are all set.

Exit psql

\q 

Create user adempiere in the database

createuser -P adempiere 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n

(remember the password you give to adempiere user)

createdb adempiere -O adempiere 

Now you have the adempiere user and the adempiere database there with pljava installed and ready to be populated.

Exit postgres user and root user (most likely become adempiere (Unix) user again).

... unzip Adempiere ... unzip database ... import database, check logs ... start Adempiere ... add init script