How to install Adempiere with Postgres on MacOSX 10.5

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

Setup Adempiere | Postgres in MacBook

  • This setup requires the following downloads to be installed in order for Adempiere to start properly.
    • 1. MacOS Xcode Tools
    • 2. Java
    • 3. Postgres
    • 4. Adempiere

Xcode Tools

Java

  • You should have the latest Java SDK after installing Xcode Tools.
  • Edit the .profile in your Home folder to setup Java path as shown:
    • export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/<Home>
    • export PATH=$PATH:$JAVA_HOME/bin/
  • Check your Java version by typing the following on the Terminal window:
    • java -version
  • It shall display the following:
    • java version "1.5.0_13"
    • Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
    • Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
  • If there's any problem with tools.jar, you have to create a symbolic link like this:
    • sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/tools.jar

Postgres

  • There are many ways to install Postgres into your Mac. Either http://www.postgresqlformac.com or the more effective http://www.enterprisedb.com/products/download.do.
  • Download the unified installler and install. The installer also does the following:
    • 1. Create the user account postgres in my Mac. This account is use to operate the postgres database.
    • 2. Install the startup script so that the postgres database is started after booting.
  • The postgres database is installed in /Library/PostgreSQL8/

Postgres-folder.jpg

  • Edit your .profile to add path to postgres
    • export POSTGRES_HOME=/Library/PostgreSQL8
    • export PATH=$PATH:$JAVA_HOME/bin/:$POSTGRES_HOME/bin/

Need to reset mac root | postgres password

  • If you have the password to an account that is an administrator on the system, then it is easy to recover the password using the sudo command.
  • Open a terminal window and type:
    • sudo passwd root
    • sudo passwd postgres

Postgres access

  • I am setting up Adempiere in my MacBook. Therefore, no DNS and some other server settings for me. My assigned IP from my wireless network is 192.168.1.2. You can determine that using the cmd ifconfig using the Terminal.
  • Edit the file pg_hba.conf to enable access which is within the POSTGRES_HOME/data folder
  • You need to be the postgres user to add the following to the file.

host all all 127.0.0.1/32 trust

host all all 192.168.1.2/32 trust

ADempiere

  • Download the Adempiere binaries and extract them into the /Application/Adempiere folder.
  • Edit the .profile to set path as follows:
    • export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/<Home>
    • export ADEMPIERE_HOME=/Applications/Adempiere
    • export POSTGRES_HOME=/Library/PostgreSQL8
    • export PATH=$PATH:$JAVA_HOME/bin/:$POSTGRES_HOME/bin/
  • check similar setup for windows xp / postgres setup in Adempiere install FAQ.

Setup

  • In the Adempiere_Home folder, type ./RUN_Setup in the terminal to start the Adempiere setup. The setup will check the following:
    • 1. Java Home
      • Select the Mac Java JVM
    • 2. Adempiere Home
      • Input the installed Adempiere folder
    • 3. Application Settings
      • Select jboss as the App Server. Setup ports for Web as 8088 and SSL as 4443.
      • Check your firewall to ensure that access is granted.
    • 4. Database Settings
      • Select the database type as postgresql.
      • Create a user adempiere with password adempiere.
      • The system user postgres should have password postgres.
      • The system user is created upon installation of the postgres.
    • Download and install PgAdmin to create the account adempiere user.
    • 5. Mail Settings
      • No / default inputs here. Can add later after installation.

Adempiere-mac-postgres-setup.jpg

    • Click on the Test button to check the settings.
    • When the settings are confirm correct, Click on the Save button to save the settings. This will save the settings and deploy the application server.
    • Check the log to confirm if the settings are correct.

Mac-run-adempiere.jpg

Importing the Adempiere database into Postgres

  • In the Adempiere_Home/utils folder, type ./RUN_ImportAdempiere.sh to start the import database script.
  • Make sure that your paths are setup properly in your .profile.
  • This script will read your saved settings and create the database tables for Adempiere.

The Server Host

  • For machines without DNS like my macbook, we may need server alias for assigned IP address for JBOSS to run.
  • You can determine local assigned IP by DHCP by ifconfig.
  • edit the etc/hosts to add the assigned local IP address and the server name
    • 127.0.0.1 localhost
    • 192.168.1.2 rhaneys
    • 255.255.255.255 broadcasthost

Starting the application server

  • In the ADEMPIERE_HOME/util/ folder, type ./RUN_Server2.sh to start the app server.

Starting the Client

  • In the Adempiere_Home folder, type ./RUN_Adempiere.sh to start the client application.

Run-adempiere-mac.jpg

  • You login using the default user into the demo database. Check your settings if you are unable to login.

Running from Eclipse by Redhuan D. Oon

  • In Eclipse it may hit an error where the locale is not set. To solve this go to the Configuration of your Debug/Run window and at the Environment Tab set the following Variables with Values:
LANG = en_US.UTF-8 
LC_ALL = en_US.UTF-8
  • I didn't need to set anything in pg_hba.conf when i set my HOST SERVER to 'localhost'. Putting my pc name gave me hell for 2 days. Managed to solve it in 1 minute thanks to RhodiumToad from the postgres room at irc.freenode.net. -