Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
id
Overview
This article provides series of guides to install ADempiere with PostgreSQL 8.2
on a Linux systems.
Install with:
$ ./jdk-1_5_0_11-linux-i586-rpm.bin
If you run the following command and see the same result, you re doing good.
$ java -version
www.goodwill.co.id
This will create a directory postgresql-8.2.1 under the current directory with the
PostgreSQL sources. Change into that directory for the rest of the installation
procedure.
Add .bash_profile file in postgres home directory for user postgres environment
variable
$ cat >> /u01/app/pgsql/.bash_profile <<EOF
# .bash_profile
PATH=$PATH:$HOME/bin
export PATH
www.goodwill.co.id
PGLIB=/u01/app/pgsql/lib
PGDATA=/u02/pgdata
export PGLIB PGDATA
EOF
PostgreSQL doesn't allow root to start up the server for security reasons, so next
you'll have to change the owner of the files:
$ chown -R postgres:postgres /u01/app/pgsql
#!/bin/sh
# postgresql This is the init script for starting up the PostgreSQL
# server
#
# chkconfig: - 64 36
# description: Starts and stops the PostgreSQL backend daemon that handles \
# all database requests.
# processname: postmaster
# pidfile: /var/run/postmaster.pid
www.goodwill.co.id
# Get config.
. /etc/sysconfig/network
else
SU=su
fi
export PGDATA
export PGPORT
[ -f "$PGENGINE/postmaster" ] || exit 1
script_result=0
start(){
PSQL_START=$"Starting ${NAME} service: "
else
echo
echo "$PGDATA is missing. Use \"service postgresql initdb\" to
initialize the cluster first."
echo_failure
echo
exit 1
fi
echo -n "$PSQL_START"
www.goodwill.co.id
stop(){
echo -n $"Stopping ${NAME} service: "
$SU -l postgres -c "$PGENGINE/pg_ctl stop -D '$PGDATA' -s -m fast" >
/dev/null 2>&1 < /dev/null
ret=$?
if [ $ret -eq 0 ]
then
echo_success
else
echo_failure
script_result=1
fi
echo
rm -f "/var/run/postmaster.${PGPORT}.pid"
rm -f "/var/lock/subsys/${NAME}"
}
restart(){
stop
start
}
initdb(){
if [ -f "$PGDATA/PG_VERSION" ]
then
echo "Data directory is not empty!"
echo_failure
www.goodwill.co.id
else
echo -n $"Initializing database: "
if [ ! -e "$PGDATA" -a ! -h "$PGDATA" ]
then
mkdir -p "$PGDATA" || exit 1
chown postgres:postgres "$PGDATA"
chmod go-rwx "$PGDATA"
fi
# Clean up SELinux tagging for PGDATA
[ -x /sbin/restorecon ] && /sbin/restorecon "$PGDATA"
# Initialize the database
$SU -l postgres -c "$PGENGINE/initdb --pgdata='$PGDATA' --
auth='ident sameuser'" >> "$PGLOG" 2>&1 < /dev/null
# Create directory for postmaster log
mkdir "$PGDATA/pg_log"
chown postgres:postgres "$PGDATA/pg_log"
chmod go-rwx "$PGDATA/pg_log"
condstop(){
[ -e /var/lock/subsys/${NAME} ] && stop
}
reload(){
$SU -l postgres -c "$PGENGINE/pg_ctl reload -D '$PGDATA' -s" > /dev/null
2>&1 < /dev/null
}
# This script is slightly unusual in that the name of the daemon (postmaster)
# is not the same as the name of the subsystem (postgresql)
stop
;;
status)
status postmaster
script_result=$?
;;
restart)
restart
;;
initdb)
initdb
;;
condrestart)
condrestart
;;
condstop)
condstop
;;
reload|force-reload)
reload
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|condstop|reload|
force-reload|initdb}"
exit 1
esac
exit $script_result
If it has been done, then we can start the postgresql service by the following
command :
$ /etc/rc.d/init.d/postgresql start
or we can set postgresql service to start every time the computer boot .
www.goodwill.co.id
Install PLJava
Login as root and create directory:
$ mkdir /u01/app/pgsql/pljava
$ mkdir /u01/app/pgsql/jdbc
Get the lastest PostgreSQL jdbc driver and put into /u01/app/pgsql/jdbc. Set
appropriate owner :
$ chown -R postgres:postgres /u01/app/pgsql/jdbc
# define the class path that the JVM will use when loading the
# initial library. Only meaningful for non GJC installations
pljava.classpath = '/u01/app/pgsql/pljava/pljava.jar'
And then scroll up even more until you find the Connection settings. Uncomment
these lines and make the necessary changes. This is when you need to connect to
PostgreSQL from other computers on the network.
listen_address = '192.168.0.10'
port = '5432'
Create Shema
SQL command :
ADempiere=# CREATE SCHEMA ADempiere AUTHORIZATION ADempiere;
Disconnect Database
ADempiere=# \q
Now login as root. Assuming the previous installation steps were successfully
done by you (e.g. PostgreSQL is running), execute the ADempiere setup script.
$ cd /u01/app/ADempiere
$ ./RUN_setup.sh