Wednesday, October 22, 2014

Quickly Install Mifos X 1.25 on Debian/Ubuntu

I'm pleased to announce that Mifos X version 1.25, the world's leading platform for financial inclusion now can be installed automatically in minutes on Debian/Ubuntu or any similar distribution, using a deb package. I recently packaged Mifos X 1.25 into a Debian package and also setup a Debian repository for the same to facilitate this quick installation. For the impatient, jump straight to the section "Installing Mifos X 1.25 on Debian/Ubuntu". If you're still with me, read on for the back story..

This contribution came as a result of a recurring itch which I've been feeling for a long time now. This summer, I first tried to install the new Mifos X platform. At that time, I was new to Amazon Web Services and since I have a VPS with ample resources, plus a few Virtual Machines my preferred mode was manual installation on Ubuntu/Debian server. Following the steps in INSTALL.md and after the couple of hiccups, got it working on a Ubuntu VM and then installed an online demo on my Debian VPS. Over the months and weeks that followed, I often thought about improving this installation process and also found others on the mailing list facing problems getting stuck at some stage of manual installation. On a couple of Mifos users meetups Ed from the Mifos Initiative a lot of people run Mifos from Debian and Ubuntu though they did not have any concrete statistics on this. So finally I decided to answer this need and build the package and repository.

Mifos X is the world's leading Platform for Financial Inclusion with a great community, awesome architecture and cutting edge technology. Mifos X has always been available as Open Source and the repository is hosted on github.com and stable releases are available on sourceforge.net. Despite Mifos X availability, there was always the challenge of following the entire process documented in the INSTALL document. This process involves several steps:

  1. Installing Tomcat7
  2. Installing MySQL Server
  3. Installing JDK (via the OpenJDK 7 package on Debian/Ubuntu)
  4. Downloading and extracting the Mifos X release zip file
  5. Setting up and initializing the mifosplatform-tenants database
  6. Setting up and initializing the mifostenant-default database
  7. Creating a keystore with SSL private & public key pair
  8. Configuring Tomcat server.xml
  9. Dropping the mifosng-provider.war into the tomcat webapps directory
  10. Copying the community-app and api-docs folders into webapps/ROOT

After following all these steps there were a couple of issues I faced. First the MySQL root password had to be mysql. If it was something else, it wouldn't work. Second, the recent Mifos X releases require the use of JDK 7 but the default setting for Tomcat is to use JDK 6, so the /etc/default/tomcat7 needs to be modified to use JDK 7. Then, with the recent release, there was also the increase in memory requirement for Tomcat which needed to be configured in /etc/default/tomcat7. Apart from doing the steps mentioned above, I also ensured the deb package installation takes care of the above caveats, so now this installation process takes care of everything and gives you a working Mifos X setup with the provider app in the backend and the community app running on Tomcat.

Installing Mifos X 1.25 on Debian/Ubuntu

To install Mifos X 1.25 on Debian simply run these lines as root:
# echo deb http://mifos.sanjosesolutions.in stable main > /etc/apt/sources.list.d/mifosx.list
# apt-get update
# apt-get install mifosx
For Ubuntu, the steps are:
$ echo deb http://mifos.sanjosesolutions.in stable main |
                  sudo tee /etc/apt/sources.list.d/mifosx.list
$ sudo apt-get update
$ sudo apt-get install mifosx
That's it! You'll be prompted for the MySQL root password, which is used to create the 2 databases, and the username and password of the account to access Mifos. You'll also be asked for information to generate the SSL keys since Mifos X community Application runs on HTTPS (HTTP over SSL). It is our hope that many more people will be able to get started quickly with MifosX through this effort. Spread the word and join us in the fight against poverty.

Report your experiences to the Mifos X mailing list mifos-users@lists.sourceforge.net
Check out the github repo at https://github.com/SanjoseSolutions/mifosx-packager
Send feedback to terence@sanjosesolutions.in

UPDATE: Here's a YouTube screencast of the live installation process:

7 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. For an alternative Mifos X simple deployment package, which works on Windows also, see http://blog2.vorburger.ch/2015/03/mifos-standalone-package-how-to.html. Also I like your https://www.youtube.com/watch?v=sqCbxfeKfAA video! ;-)

    ReplyDelete
  3. I have installed Mifos X 15.03 release version by following your instruction of automated installation on ubuntu. Now I can run and test community app. But what I want is to change the default language of community app into my language (Vietnamese). Please help me how can I do that? Thanks and regards!

    ReplyDelete
  4. Can anyone helps me installing the Dev package ?, i am using eclipse; I see this tutorial can only help for the release package.

    ReplyDelete
  5. Re. how to set-up an Eclipse environment to code (the Dev package), have you seen and followed the documentation on https://github.com/openMF/mifosx/wiki/Eclipse ? If you run into any particular issues, please subscribe to and post the problem you ran into on the https://lists.sourceforge.net/lists/listinfo/mifos-developer mailing list, and someone may respond. (Tip: The best way to get responses on such mailing lists is usually a clear question à la "I have following the instructions from... and done ... but ..." kind of thing.)

    ReplyDelete
  6. Hi. when left the password field blank This will show error.

    Creating config file /etc/default/tomcat7 with new version
    Adding system user `tomcat7' (UID 109) ...
    Adding new user `tomcat7' (UID 109) with group `tomcat7' ...
    Not creating home directory `/usr/share/tomcat7'.
    * Starting Tomcat servlet engine tomcat7 [ OK ]
    Setting up mysql-server (5.5.46-0ubuntu0.12.04.2) ...
    Setting up mifosx (15.09-1) ...
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    dpkg: error processing mifosx (--configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for libc-bin ...
    ldconfig deferred processing now taking place
    Errors were encountered while processing:
    mifosx
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    ReplyDelete
    Replies
    1. the same error occurs when i use a password for mysql

      Delete