How to Setup Opentaps 1.5M2 on Ubuntu Server 10.10

There was this one guide I followed to install Opentaps on a Ubuntu machine, but it was so badly written that I had to rewrite it for future reference. Also, it was a bit outdated (using Java 1.5 as opposed to OpenJDK 1.6).

Note: I’m a FreeBSD guy, so getting Ubuntu running required a bit of reading when it came to installing packages. Luckily, Ubuntu has apt-get, which is similar to the ports system.

Install Ubuntu 64-bit

Whether you are a seasoned veteran or a newbie to Linux, you’re going to have to install Ubuntu by yourself. The only advice I would give here is to cut out the desktop crap and run the server headless, so that means no pretty GUI to manage your box (unless you require the POS module to be on the same machine). Since I’m installing this on ESXi (virtual machine) I won’t need anything besides a TTY console.

During the installation of Ubuntu, you will be presented with the ability to install common services and daemons (DNS, LAMP, Mail, OpenSSH, etc.). At this stage, you can install the following if you wish to do so: OpenSSH and PostgreSQL database.

As a means of keeping servers separate, I have opted-out from installing Apache, DNS, PHP and other unnecessary services. This machine is solely made for Opentaps and nothing else. I have another VM that will act as a web server to handle visitors, and another machine for DNS.

ESXi or VM users: don’t forget to installĀ vmWare Tools, or the necessary software to make your server run more efficiently on a host.

For my own reference, here’s how to install vmware-tools on Ubuntu (headless).

# sudo apt-get install –no-install-recommends open-vm-dkms
# sudo apt-get install –no-install-recommends open-vm-tools

Required Packages to Install

At the time of writing this guide, JDK is at version 1.6, so we’ll install that. If you have gone ahead and installed the GUI for Ubuntu, then you can use the Synaptics Package Manager to install the following.

  • openjdk-6-jdk
  • openjdk-6-jre-headless
  • ant
  • postgresql-8.4
  • postgresql-client
  • pgadmin3
  • libqt4-core

For the console guys out there, you can use apt-get:

# sudo apt-get install <package name>

PostgreSQL Configuration

Change the password for the postgres user.

# sudo su postgres -c psql template1

This will drop you to the psql console. Now run the command to change the password.

# ALTER USER postgres WITH PASSWORD ‘yourpasswordhere’;

Now you can quit.

# \q

Next step is to change the postgres user in Linux.

# sudo passwd -d postgres
# sudo su postgres -c passwd

Next, we’ll create the opentaps database and the appropriate user.

# su postgres
# createuser -W opentaps
# createdb opentaps
# exit

Change the password for the opentaps user.

# sudo su postgres -c psql template1
# ALTER USER opentaps WITH PASSWORD ‘yourpasswordhere’;
# \q

Time to modify the PostgresSQL host configuration (pg_hba.conf) file.

# sudo nano /etc/postgresql/8.4/main/pg_hba.conf

Comment out the following:

host all all 127.0.0.1/32 md5

And add the following at the end of the file.

host opentaps opentaps 127.0.0.1 255.255.255.255 password

Save and close the editor. Let’s go ahead and restart PostgreSQL to reflect the new changes in the host configuration file.

# sudo /etc/init.d/postgresql restart

Download the latest Opentaps. At the time of this guide, it’s 1.5M2. Place it in a directory of your choice. I left it under my user’s home folder.

Opentaps Configuration Files

Go to your freshly extracted Opentaps directory and do the following

# sudo nano framework/entity/config/entityengine.xml

Around line 54: Under the Default directive, modfy the “datasource-name” attribute from “localderby” to “localpostgres”.

<group-map group-name=”org.ofbiz” datasource-name=”localderby”/>

Around line 442: Under the localpostgres directive, change the “jdbc-uri” attribute to “jdbc:postgresql://127.0.0.1/opentaps”.

Around line 443: Change the jdbc-username to “opentaps”.

Around line 444: Change the jdbc-password to the one you chose above.

Save and close the file (CTRL+0, CTRL+X).

Verify Database Connectivity

To see whether we can connect to the opentaps database, do the following:

# psql -h 127.0.0.1 -p 5432 -U opentaps -W opentaps

If you do not receive any error messages, we’re good to go. You can now quit:

# \q

Build and Run Opentaps

Before we build Opentaps, we must set the correct Java paths.

# export JAVA_HOME=/usr/lib/jvm/openjdk-1.6.0-jdk
# export PATH=$PATH:$JAVA_HOME/bin

Do ONE of the the following sets to build and run Opentaps. It took exactly 8 minutes on a Xeon 2.4 quad core VM with 4 GB of memory.

Set 1: (default, load demo data)
# ant run-install

Set 2: (does not work)
# ant run-install-seed (without demo data)
# ant create-admin-user-login (to create the first user for administrative purposes)

Set 3: (fresh install, fixed)
# sudo nano opentaps/component-load.xml

Uncomment the following line: <load-component component-location=”mycompany”/>

# ant run-install-extseed (unknown)

Once the build is complete and no errors were reported, we can now run Opentaps. When I ran this command, it took an additional 2 minutes for the system to startup (most likely configuring the database on first use).

# ./startofbiz.sh

Run your favourite web browser and type in:

http://yourip:8080/opentaps

to see whether Opentaps is loading the login screen (again, might take a few minutes to show up the first time). The default Opentaps username and password is admin/ofbiz. Don’t forget to change your password!

If you wish to stop Opentaps, just run:

# ./stopofbiz.sh

That’s it!

One thought on “How to Setup Opentaps 1.5M2 on Ubuntu Server 10.10

  1. great jobs!!
    I follow the steps and works perfectly.
    But the default opentaps password “opentaps” not “ofbiz”

Comments are closed.