Installing LedgerSMB with Homebrew on OS X
I use LedgerSMB for doing the finances for Drupal Danmark and Högh I+O. I recently moved my installation to a Mac, and reinstalled it with Homebrew.
I thought my installation notes might be useful to others, so there they
are. Shell commands are denoted with $
. The $
is not part of the
command, so leave it out if you copy and paste.
This assumes that you have Homebrew set up and configured, so it will use the Perl version installed from Homebrew rather than the one that ships with OS X.
Take a gander at my .zshrc if you need inspiration on how to set that up.
- Download LedgerSMB
- Go to its folder (in this case,
/Users/mikl/Sites/ledgersmb
) $ brew install perl httpd
(be sure to read the instructions on how to run Apache HTTPD as a service, homebrew will tell you the commands to use).$ cpan install Module::Install Data::Dumper Log::Log4perl Locale::Maketext DateTime Locale::Maketext::Lexicon DBI MIME::Base64 Digest::MD5 HTML::Entities DBD::Pg Math::BigFloat IO::File Encode Locale::Country Locale::Language Time::Local Cwd Config::Std MIME::Lite Template Error CGI::Simple File::MimeInfo Config::Std
$ vim /usr/local/etc/apache2/httpd.conf
and change the port number to something else. In this example I’m using 34567.
Additionally, addInclude /usr/local/etc/apache2/extra/ledgersmb-httpd.conf
on a single line at the end of the file.$ cp ledgersmb-httpd.conf.template /usr/local/etc/apache2/extra/ledgersmb-httpd.conf
$ vim /usr/local/etc/apache2/extra/ledgersmb-httpd.conf
- Replace
WORKING_DIR
with/Users/mikl/Sites/ledgersmb
$ cp ledgersmb.conf.default ledgersmb.conf
- Edit
ledgersmb.conf
and setcontrib_dir
to/usr/local/share/postgresql/extension
$ perl -p -i -e 's/^#!\/usr\/bin\/perl/#!\/usr\/local\/bin\/perl/' *.pl
- Go to http://localhost:34567/ledgersmb/setup.pl and configure the database. You will need to have PostgreSQL installed and configured for this step, but since I already had that, I will not cover it here.