Installing LedgerSMB with Homebrew on OS X

Published on Tue, 2013-07-16 - 22:25

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.

  1. Download LedgerSMB
  2. Go to its folder (in this case, /Users/mikl/Sites/ledgersmb)
  3. $ 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).
  4. $ 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
  5. $ vim /usr/local/etc/apache2/httpd.conf
    and change the port number to something else. In this example I'm using 34567.
    Additionally, add Include /usr/local/etc/apache2/extra/ledgersmb-httpd.conf on a single line at the end of the file.
  6. $ cp ledgersmb-httpd.conf.template /usr/local/etc/apache2/extra/ledgersmb-httpd.conf
  7. $ vim /usr/local/etc/apache2/extra/ledgersmb-httpd.conf
  8. Replace WORKING_DIR with /Users/mikl/Sites/ledgersmb
  9. $ cp ledgersmb.conf.default ledgersmb.conf
  10. Edit ledgersmb.conf and set contrib_dir to /usr/local/share/postgresql/extension
  11. $ perl -p -i -e 's/^#!\/usr\/bin\/perl/#!\/usr\/local\/bin\/perl/' *.pl
  12. Go to http://localhost:34567/ledgersmb/ 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.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.