Tag Archives: adempiere

Below is the script I used to startup Adempiere in my Ubuntu Server.

#! /bin/sh -e
# /etc/init.d startup script for ADempiere
#

# Script layout borrowed from anachron.

# path to JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16

# path to ADEMPIERE_HOME
ADEMPIERE_HOME=/opt/Adempiere

# add to path
PATH=$JAVA_HOME/bin:$ADEMPIERE_HOME/utils:$PATH

export JAVA_HOME ADEMPIERE_HOME

test -x $ADEMPIERE_HOME/utils/RUN_Server2.sh || exit 0

# Get lsb functions
. /lib/lsb/init-functions

case "$1" in
 start)
 log_daemon_msg "Starting Adempiere server" "adempiere"

 start-stop-daemon --start --exec $ADEMPIERE_HOME/utils/RUN_Server2.sh >> /dev/null &
#    $ADEMPIERE_HOME/utils/RUN_Server2.sh

 log_end_msg 0
 ;;
 stop)
 log_daemon_msg "Stopping Adempiere server" "adempiere"

 start-stop-daemon --stop --oknodo --quiet --exec $ADEMPIERE_HOME/utils/RUN_Server2Stop.sh >> /dev/null &

 log_end_msg 0
 ;;
 *)
 echo "Usage: /etc/init.d/adempiere {start|stop}"
 exit 2
 ;;
esac

exit 0

I saved above script in a file named adempiere and placed it in /etc/init.d folder. Just need to change the JAVA_HOME and ADEMPIERE_HOME values according to your server settings. Then I register startup script with Ubuntu with below command:

sudo update-rc.d /etc/init.d/adempiere defaults

Restart your server, and you should see your Adempiere will startup during server bootup.

References:
http://www.adempiere.com/index.php/ADempiere_Dedicated_Server

Related softwares:

  1. Ubuntu 9.04
  2. Postgresql 8.3
  3. Adempiere 3.4.2

Pre-requisite of installing Adempiere, is to setup a supported database which could be Oracle or Postgresql. In this article, I’ll be using Postgresql 8.3. To learn more on how to install Postgresql in Ubuntu, you can go here. Also, in Postgresql, create a login-role named adempiere and create a database named adempiere. Assign the owner of this adempiere database to adempiere login-role.

You need to download the Adempiere archive file from sourceforge.net URL below:
http://sourceforge.net/projects/adempiere/files/ADempiere%20Official%20Release/Adempiere%203.4.2-stable/Adempiere_342s.tar.gz/download

Unzip the archive file and you will get a folder named Adempiere. Place it anywhere to your liking. As for me, I will put it under /opt, so my $ADEMPIERE_HOME will be /opt/Adempiere.

First, you need to restore the database from the provided dump file. Run the command below:

sudo  -u postgres psql adempiere < $ADEMPIERE_HOME/data/Adempiere_pg.dmp

You will see in the console, the Postgresql script is running and creating the necessary tables and data into adempiere database.

Second, you need to execute the setup script. I found that before running the setup script, I need to give execution permission to the script. So type the following to do so:

sudo chmod +x $ADEMPIERE_HOME/RUN_setup.sh

Then I execute the setup script as below:

sudo $ADEMPIERE_HOME/RUN_setup.sh

You will get the Adempiere Server Setup dialog as below:
Adempiere Server Setup

If you don’t wish to use the default values, you can change it to below values:

  1. Web Port : 8088
  2. SSL : 4443
  3. Database Server : localhost
  4. Database Type : postgresql
  5. Database Name: adempiere
  6. System Password: [postgres password in Postgresql]
  7. Database User: adempiere
  8. Database Password: [adempiere password in Postgresql]

Click on the Test button, if everything goes well you should be able to see the Save button is enabled. Click on the Save button. A License Agreement dialog will pop-up. Click on Yes, I Understand and Accept button. You should be able to see on the console, where your ran the RUN_setup.sh script, is running and processing as shown below:
Adempiere Setup Console

Once you see, BUILD SUCCESSFUL in the console, you can close everything.

Next you can run the Adempiere script like below:

$ADEMPIERE_HOME/RUN_Adempiere.sh

By default, Adempiere comes with default data, so you can login with sample data. Try login with username and password as GardenAdmin.