[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing lsmb-1.3 on OS x 10.6.8

On Aug 6, 2012, at 11:49 AM, Paul Bente wrote:

> I have successfully installed ledgersmb-1.3.20 on OS X 10.6.8 (Snow Leopard) and have
> a text file summary of the steps I used. Where is the best place to contribute this?
> It could certainly benefit from comments / edits from others.
> Best Regards,
> Paul Bente

I have included my installation steps and comments below:

Installing LedgerSMB 1.3 on Mac OS X 10.6.8 (Snow Leopard) 2012-08-06

These instructions should work for ledgersmb-1.3.21 or higher. Earlier versions would
need to be patched to run. OS X comes with Perl and Apache installed. In addition to
LedgerSMB, you need to install PostgreSQL and the necessary Perl modules and latex and
pdflatex. You also need some understanding of how to use Terminal.app and some
familiarity with the command line, as many installation steps are much more easily done
or must be done in Terminal. I use pico to edit the configuration files in Terminal.
Figure on a day or two to get this all running, especially if you need to compile a lot
of CPAN modules. There are many paths to accomplish an install. The following worked
for me, based on the instructions in ledgersmb/INSTALL. Special thanks to Chris Travers
and Andy Satori for their patient help with this.

1. Install ledgersmb:
In OS X ledgersmb should be installed in /Library/Webserver/Documents in order to be
found by Apache. Download legersmb-1.3.xx.tar.gz from Sourceforge. Double click to
unpack and then drag the ledgersmb folder into /Library/Webserver/Documents. Use
terminal to adjust permissions as follows: (Note that you need to switch to a user with
admin privileges to use sudo.)

$cd /Library/Webserver/Documents
$sudo chown root:admin ledgersmb
$cd ledgersmb
$sudo chown -hR _www:_www *
$sudo chmod 711 templates css spool

2. Set up Apache:
Start or stop Apache in System Preferences > Sharing > Web Sharing.
On OS X Apache will read /private/etc/apache2/httpd.conf and also all config files in
/private/etc/apache2/users, so use that directory to store the ledgersmb-httpd.conf
In Terminal edit the ledgersmb-httpd.conf.template to substitute
“/Library/Webserver/Documents/ledgersmb” for every occurrence of “WORKING_DIR” and save
as ledgersmb-httpd.conf. I use the pico editor for these simple tasks.

Verify that apache is running by looking for the process ‘httpd’ in Activity Monitor.
In Terminal run:
/Library/WebServer/Documents/ledgersmb$ sudo sh configure_apache.sh
Which user does your web server run as?
Where do we copy the ledgersmb-httpd.conf file to?

3. Install PostgreSQL9.1.4
Andy Satori at www.postgresqlformac.com provides a very convenient oss .pkg
installation of PostgreSQL (9.1.4 at this writing) for OS X with a convenient
Preference Panel for System Preferences to turn the server on and off, to adjust
configuration, and has a convenient way of handling versions. Following OS X
conventions the installation is in /Library/PostgreSQL.
Install the postgresqlformac server package.

Use Terminal to edit pg_hba.conf
cd to /Library/PostgreSQL/share/postgresql
$sudo pico pg_hba.conf.sample
and add 
host   all   all    md5
in the appropriate place and save as pg_hba.conf

Use the PostgreSQL Preference Panel in System Preferences to start and stop the server.
Verify that ‘postgres’ process is running in Activity Monitor

Verify that psql is working and set a password for user ‘postgres’ by running in
$cd /Library/PostgreSQL/bin
$./psql -U postgres
you get the # psql prompt
	#alter user postgres with passwd ‘postgresqlpswd’

4. Install  the full MacTex or the “smaller version” from http://www.tug.org/mactex
latex and pdflatex are located in /usr/texbin.
--Note need to provide paths later for ledgersmb.conf and when setting up perl module
Template::Plugin::Latex and I still need to determine whether “path to latex” means
‘/usr/texbin’ or ‘/usr/texbin/latex’---

5. Configure Perl and Modules
I run Perl 5.8.9 although 5.10.0 is also available in OSX 10.6.8. However 5.10.0 is
considered kind of buggy and 5.8.9 is sufficient for ledgersmb.
I used CPAN to install the necessary modules. You may have to install a lot of
prerequisites which will take some time. Look for information on perl and CPAN on OS X
if you are unfamiliar with it.
Look in ledgersmb/INSTALL for the list of required and optional perl modules.

Install modules with CPAN in terminal using
$sudo perl -MCPAN -e "shell"
note: DBD::Pg has path to pg_ctl specified, which is /Library/PostgreSQL/bin in this

cd to ledgersmb and run
$sudo perl Makefile.PL
$sudo make install

I installed optional perl modules:

But was so far unsuccessful with CPAN install of:
Need more work on this.

6. Edit ledgersmb.conf
In Terminal 
sudo pico ledgersmb.conf.default
then save as ledgersmb.conf
I changed the following lines:
PATH: /bin:/usr/bin:/usr/local/bin:/Library/PostgreSQL/bin:/usr/texbin
Laser      = lpr -PHP_LaserJet_1320_series
#(note use cupsd to find the appropriate names for printers)
contrib_dir = /Library/PostgreSQL/share/postgresql/extension/

7. Initialize Company Database
Open Safari (or your preferred web browser) and connect to http://localhost/ledgersmb/setup.pl
Get Database Management Console
Super-user: postgres
Database: merlintest

Note: For the alternative method  of initializing the company database by running
initialize_company.sh view status of bug # 3551127 at


Server errors on connecting to setup.pl or login.pl will show up in the apache2 log,
which can be viewed using the OS X Console.app.
Error messages are also written to the files:

from ledgersmb-1.3-xx to a higher xy (xy>xx):
Check the INSTALL or upgrade notes to see if anything special needs to be done for that
particular version. You need to replace the contents of
'/Library/Webserver/Documents/ledgersmb' with the updated version of ledgersmb but you
first need to save the 'ledgersmb.conf' file you have customized somewhere so it won’t
be lost. Then repeat the install instructions in step 1 and copy the 'ledgersmb.conf'
file back.

Because we used the method 
$sudo perl Makefile.PL
$sudo make install
to update the perl modules, you must run this again to complete the upgrade.

Best regards,
Paul Bente