Difference between revisions of "Install on Ubuntu 8.04"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
m
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
[[Category:Documentation]]
 +
[[Category:HowTo]]
 +
[[Category:Installation]]
 
Document created: [[User:Gabriel|Gabriel]] 17:42, 15 September 2008 (EDT)
 
Document created: [[User:Gabriel|Gabriel]] 17:42, 15 September 2008 (EDT)
  
Line 4: Line 7:
  
 
This document has a lot of common with [[Debian_and_PostgreSQL_Install]] as Ubuntu and Debian have a lot of common too :)  
 
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.04 installed (32 bit for now).
 
Let's assume you have Ubuntu 8.04 installed (32 bit for now).
Install sudo and wget packages, we will need them.
 
  
  sudo apt-get install sun-java6-jdk postgresql-8.3 postgresql-server-dev-8.3
+
  sudo apt-get install sun-java6-jdk postgresql-8.3 postgresql-server-dev-8.3 wget
  
 
This will most likely install some other packages as well (enter root password for sudo, say yes).
 
This will most likely install some other packages as well (enter root password for sudo, say yes).
Line 29: Line 33:
 
ii  sun-java6-jre                        6-06-0ubuntu1              Sun Java(TM) Runtime Environment (JRE) 6 (ar
 
ii  sun-java6-jre                        6-06-0ubuntu1              Sun Java(TM) Runtime Environment (JRE) 6 (ar
 
</pre>
 
</pre>
 +
 +
For Postgresql 8.3 related issues see: [[PostgreSQL_8.3_issues]]
 +
  
 
Okay, now something harder:
 
Okay, now something harder:
Line 86: Line 93:
 
'''You are root from now, so take care!'''
 
'''You are root from now, so take care!'''
  
Create a file named /etc/ld.so.conf.d/jvm.conf and add the following: ''/Note that for other platforms the i386 will be different!/''
+
Edit /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
 +
 +
Create a file named /etc/ld.so.conf.d/jvm.conf and add the following:
 +
 +
for i386
 
<pre>
 
<pre>
 
/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386
 
/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386
Line 93: Line 105:
 
/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads
 
/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads
 
</pre>
 
</pre>
 +
 +
''or'' for AMD64
 +
<pre>
 +
/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
 +
</pre>
 +
  
 
Run ldconfig
 
Run ldconfig
Line 114: Line 134:
 
pljava.debug = false
 
pljava.debug = false
 
</pre>
 
</pre>
 +
 +
Edit /etc/postgresql/8.3/main/postgresql.conf and 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:
 
Edit /etc/postgresql/8.3/main/environment and add at the end:
Line 142: Line 168:
 
Become postgres user and then run psql  
 
Become postgres user and then run psql  
  
su - root
 
 
  su - postgres
 
  su - postgres
 
  psql
 
  psql
Line 162: Line 187:
 
in psql. If sqlj is there, then you are all set.
 
in psql. If sqlj is there, then you are all set.
  
 +
Exit psql
  
( ... to be continued ... )
+
\q
  
[[Category:Documentation]]
+
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.
 +
 
 +
Now we need to change the password of the postgres user in the database, it's for 'DB Admin Password' of RUN_setup.sh:
 +
psql --command "ALTER USER postgres PASSWORD '<system_password>'"
 +
 
 +
Exit postgres user and root user (most likely become adempiere (Unix) user again).
 +
 
 +
... unzip Adempiere
 +
... [[InstallServer]]
 +
... unzip database
 +
... import database, check logs
 +
... start Adempiere
 +
... add init script

Latest revision as of 19:18, 18 July 2010

Document created: Gabriel 17:42, 15 September 2008 (EDT)

(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.04 installed (32 bit for now).

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

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

Let's check this:

gabriel@erpdev:~$ dpkg -l|grep postgres
ii  postgresql-8.3                        8.3.3-0ubuntu0.8.04         object-relational SQL database, version 8.3 
ii  postgresql-client-8.3                 8.3.3-0ubuntu0.8.04         front-end programs for PostgreSQL 8.3
ii  postgresql-client-common              87                          manager for multiple PostgreSQL client versi
ii  postgresql-common                     87                          PostgreSQL database-cluster manager
ii  postgresql-doc-8.3                    8.3.3-0ubuntu0.8.04         documentation for the PostgreSQL database ma
ii  postgresql-server-dev-8.3             8.3.3-0ubuntu0.8.04         development files for PostgreSQL 8.3 server-

gabriel@erpdev:~$ dpkg -l|grep java
ii  java-common                           0.28ubuntu3                 Base of all Java packages
ii  sun-java6-bin                         6-06-0ubuntu1               Sun Java(TM) Runtime Environment (JRE) 6 (ar
ii  sun-java6-jdk                         6-06-0ubuntu1               Sun Java(TM) Development Kit (JDK) 6
ii  sun-java6-jre                         6-06-0ubuntu1               Sun Java(TM) Runtime Environment (JRE) 6 (ar

For Postgresql 8.3 related issues see: PostgreSQL_8.3_issues


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

No 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:

sudo su - 

You are root from now, so take care!

Edit /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

Create a file named /etc/ld.so.conf.d/jvm.conf and add the following:

for i386

/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386
/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/server
/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads

or for 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


Run ldconfig

ldconfig -v|grep jvm

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

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

Edit /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

Edit /etc/postgresql/8.3/main/postgresql.conf and 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:

host    all         postgres    192.168.1.0/24        md5
host    all         adempiere   192.168.1.0/24        md5

(of course replace the given IP and netmask with your own.

Restart postgresql:

/etc/init.d/postgresql 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.

cd /tmp/pljava-1.4.0/src/sql

Become postgres user and then run psql

su - postgres
psql

We are in psql, now connect to template1:

\c template1 

Now run install :

\i install.sql

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.

Now we need to change the password of the postgres user in the database, it's for 'DB Admin Password' of RUN_setup.sh:

psql --command "ALTER USER postgres PASSWORD '<system_password>'"

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

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