OSX: Install LedgerSMB 1.3 on Apple OSX

Submitted by Chris Travers on

This content is outdated and kept here for reference only!

IMPORTANT NOTE: The instructions on this page, are retained for historical purposes only.
For Up To Date installation instructions please refer to Installing LedgerSMB

Update 2012:
Installing LedgerSMB 1.3.21 on Mac OS X 10.6.8 (Snow Leopard) 2012-08-06
http://permalink.gmane.org/gmane.comp.finance.ledger.smb.user/6347
LedgerSMB 1.3.14
http://permalink.gmane.org/gmane.comp.finance.ledger.smb.user/5934

Please help us to make this a better guide. Post your comments on the mailinglist.

Here's how to get LedgerSMB up and running on OSX Leopard / MacOS X (vs 10.6.8).

Software
* PostgreSQL (version 9.1.3-1)
* Perl
* LedgerSMB 1.3.X

PostgreSQL
EnterpriseDB provides a nice OSX installer here http://www.enterprisedb.com/products-services-training/pgdownload#osx. You will need to restart your computer as part of the installation. After restarting run the installer again. Install with the default values. Set and remember a password for the postgres user when prompted. Don't launch the Stack Builder at exit.

"the postgresql is installed in the Library folder and not the usr/share/...
etc folder (unless you modify the path during installation). " (apallik)

"This changes things quite significantly (especially when modifying the ledgersmb.conf file)." (apallik)

Perl
Perl comes installed on OSX. (2011: Version 5.10.0 )

LedgerSMB
Download from our Sourceforge project page and extract to /usr/local/. Your LedgerSMB directory should be /usr/local/ledgersmb.

Installation

Go to the location of ledgersmb (cd /usr/local/ledgersmb)
Copy the apache config to the correct folder and restart apache.
$ sudo cp ledgersmb-httpd.conf /etc/apache2/other
$ sudo /usr/sbin/apachectl restart

Copy and modify the default ledgersmb.conf file. Change the default_db value to ledgersmb.
Set PATH variables in your ledgersmb.conf
$ cp ledgersmb.conf.default ledgersmb.conf

and run the makefile. Select yes to installing the required modules. Select no for the optional ones.
$ cd /usr/local/ledgersmb
$ perl Makefile.PL

Run make install. This installs the required perl modules.
$ sudo make install

Ledger 1.3.x : The setup and login screen: http://localhost/ledgersmb/setup.pl
http://www.ledgersmb.org/help/install/Ubuntu_Installation_Tutorial_Ledge...

=====
Alternative install metod to http://localhost/ledgersmb/setup.pl

Homebrew
Homebrew allows you to easily build other needed software. Get it here http://mxcl.github.io/homebrew/.
gnu-sed
The install scripts for LedgerSMB aren't compatible with the default version of sed shipped with OSX. We need to install gnu-sed.
$ brew install gnu-sed
$ sudo mv /usr/bin/sed /usr/bin/sed-bsd
$ sudo ln -s /usr/local/Cellar/gnu-sed/4.*/bin/gsed /usr/bin/sed
The above commands installs gnu-sed and makes it useable.

gnu-getopt
We need gnu-getopt for the same reason as gnu-sed.
$ brew install gnu-getopt
$ sudo mv /usr/bin/getopt /usr/bin/getopt-bsd
$ sudo ln -s /usr/local/Cellar/gnu-getopt/1.*/bin/getopt /usr/bin/getopt

As an alternative to installing Homebrew and installing gnu-sed and gnu-getopt I made binaries of these programs available as gnu.zip. Just unzip to /usr/bin. Make backups of the original getopt and sed if you care about them.

Modify the tools/prepare-company-database.sh file. Replace line 190 with the following.
cat <&1 | unchatter

Run prepare-company-database.sh. The option --coa sets the charter of accounts. I selected an Australian coa. You will be prompted for your postgres password.
$ sudo tools/prepare-company-database.sh --company yourcompanyname --pgsql-contrib /Library/PostgreSQL/9.0/share/postgresql/contrib --coa sql/coa/au/chart/General-00000.sql
Now go to http://localhost/ledgersmb/. Log in with username admin, password admin, and company yourcompanyname.

Operating system
Release