Home > Developers > Build Mifos from Source > Windows Install Guide

Document Actions

Windows Install Guide

Keywords: Installation
The instructions below tell you how to get the latest source code under development.  This code is not guaranteed to be stable.  If you need to install Mifos for test, you may want to use the demonstration or test servers.

If you are interested in learning what the full deployment process is for a microfinance organization, see our Knowledge Center.

Building and Installing Mifos

Please see INSTALL in the code source repository for additional information on software pre-requisites and installation instructions. These notes are supplemental.

These instructions are designed for developers, but they may be clear enough for anyone to try setting up Mifos on a machine. A page is forthcoming that describes how to install Mifos without building from source code.

Building Mifos

Building Mifos requires that you get the source code and set up several additional programs.

You will need the following packages to build and install:

  • Java 2 Standard Edition Development Kit (JDK) 6 version 1.6.0_18
  • My SQL Version 5.1
  • Tomcat 6
  • Git 1.7.x or later
  • Maven 2.0.9 or higher
  • Eclipse JEE 3.5 or higher

Running Mifos

This page has instruction for installing and running Mifos based on the same tools used to build Mifos.  If you just want to see Mifos working, try the Test Server or Demo Server.

Steps to Build and Install Mifos

If you wish to build Mifos from source code, follow these steps.
  1. Get the source code
  2. Download and install Java SDK
  3. Install version control software: Git
  4. Install web server and databse software: Tomcat and MySQL
  5. Set Up Environment Variables
  6. Build the Application
  7. Run the Application

 Download and Install the Required Software

Install Java SDK

Get the Java SDK installed. 

  1. Before you do install a Java SDK, check to see if you have any previous versions of Java installed and uninstall them (unless you need them for something else)–-either the JVM (Java Virtual Machine) or the JDK (Developers Kit).
  2. If you you have Java installed and you don’t need that particular version, it is recommended that you uninstall it via Start menu->Control Panel->Add/Remove Programs. (ex: I had to remove java 1.4.2.)
  3. Download the Java SE JDK installer (JDK 6.0).
    • Keep in mind that newer release *could* cause changes, so be mindful if something is very new.
  4. Install the Java 2 Standard Edition Development Kit (JDK) 6.0 version 1.6.0_18.
    • We recommend using all default options during the install.

Install Tomcat Application Server

  1. Download Apache Tomcat
  2. Follow the Tomcat setup instructions


Install MySQL 

Download  mySQL 5.1

  1. Download mySQL 5.1
  2. Run MySQL setup.exe (Typical Installation)
  3. Instance Configuration Wizard - Click Next> Detailed config select
  4. Click Next> keep the selection Developer Machine 
  5. Click Next> Multifunctional DB  
  6. Click Next> InnoDB Tablespace settings c: Installation Path  
  7. Click DSS/OLAP
  8.  Click Enable TCP/IP Networking Port # 3306, check Enable Strict Mode
  9. Click Best support for Multilingualism
  10. Set up your DB password. 
  11. Grant permissions to user 'mifos' (doing these grants more than once has no effect). If you choose a different user name and password, adjust these instructions accordingly:
    mysql> GRANT ALL on mifos.* to 'mifos'@'localhost' identified by 'mifos';
    mysql> FLUSH PRIVILEGES;
  12. Test database connection as user 'mifos'
    > mysql -u mifos -pmifos mifos

 

* Make certain you note what you set for your admin user/password *

**If you need to go back and check or reconfigure these settings, use the MySQL Server Instance Config Wizard, accessible via the Start menu under MySQL Administrator 5.1.

Optional:  Install MySQL GUI Tools

You may find the MySQL 5.1 GUI tools to be helpful. 


Install Version Control Software: Git

Git is required for downloading Mifos source code.

 

 


Install Build Software: Maven

Maven is another tool used to build .war files from source and execute automated acceptance tests.

In a section below, you will be instructed on how to set up your Environment Variables.

 


Install Eclipse

Eclipse is the primary integrated development environment (IDE) we use for developing Mifos.

 


Install Firefox

Firefox web browser is required for executing the automated acceptance tests.  Firefox 3.0 or newer is supported for these Selenium tests.

 


Setup and Build

Add Required Environment Variables

These Windows environment variables must be set:

  • JAVA_HOME should be set to your Java SDK directory (ex: C:\Program Files\Java\jdk1.6.0_10)
  • CATALINA_HOME should be set to your Tomcat directory (ex: C:\Program Files\Apache Software Foundation\Tomcat 6.0)
  • M2 should be set to your Maven bin directory, (ex: C:\Program Files\Apache Software Foundation\apache-maven-2.0.9\bin) 
  • M2_HOME should be set to your Maven install directory, (ex: C:\Program Files\Apache Software Foundation\apache-maven-2.0.9) 

In addition, these options are recommended to be set as environment variables:

  • CATALINA_OPTS should be set to "-Xms1024M -Xmx1024M -XX:MaxPermSize=256m"
  • MAVEN_OPTS should be set to "-Xms512M -Xmx512M"

 

To Verify Path and Environment Variables

  1. Open a new command prompt
  2. run echo %Path% and make sure the path looks correct (including semi-colons). Notice that MySQL is also in the Path:

    C:\Documents and Settings\auser>echo %Path%
    output:
    C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickT
    me\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\Java\
    dk1.5.0_12\bin;C:\apache-maven-2.0.9\bin;c:\apache-tomcat-6.0.14\bin

c. run echo %[ENVIRONMENT VARIABLE]% for each environment variable and make certain each one is correct.  e.g.:

C:\Documents and Settings\auser>echo %JAVA_HOME%

C:\Program Files\Java\jdk1.6.0_10


Build the Application

The build process for Gazelle (Mifos trunk project) is transitioning from Ant to Maven.  Maven will build and execute the acceptance tests, while ant tasks are still required to execute unit tests. 

1) Prepare your database settings local.properties file

Defaults can be used for MySQL database connections.  Different properties are used for main usage, acceptance testing, and integration testing.  The default name and passwords can be found in the mainDatabase.properties, acceptanceDatabase.properties, and intergrationDatabase.properties files.  To use different settings, create a local.properties file in directory {user.home}\.mifos in that contains the following lines, uncomment the appropriate lines, and enter the database name, user name, and password for the accounts you created when you set up the Mifos database:


# settings used at build time and by a running/deployed Mifos instance # (defaults are in mainDatabase.properties)
#main.database=mifos
#main.database.user=root
#main.database.password=mysql

# settings used during acceptance tests
# (defaults are in acceptanceDatabase.properties)
#acceptance.database=mifos_gazelle_acceptance
#acceptance.database.user=root
#acceptance.database.password=mysql

# settings used during integration tests # (defaults are in integrationDatabase.properties)
#integration.database=test
#integration.database.user=root
#integration.database.password=mysql

User home is typically the user profile directory location that gets created under "Documents and Settings" and matches the login name of the user.  For example, "c:\Documents and Settings\jdoe\.mifos".

2) Get a local copy of the Mifos source code

See http://www.mifos.org/developers/wiki/MifosVersionControlGuide.

3) Build Mifos using Maven

  1. Execute the following command to build the gazelle project from [local mifos Gazelle src directory]:
    • mvn clean install
  2. Verify build is successful and all acceptance tests pass. 

To run unit tests:

From the root Gazelle project directory , run mvn clean test

To run only acceptance tests:

From the [root Gazelle project directory]\acceptanceTest directory , run mvn integration-test

Note that is a database does not exist, a db will be created automatically during the startup.

More information about how to build Mifos:


Run the Application

Mifos can be run as a deployed web application by downloading the Mifos war file and following the INSTALL instructions.

The following instructions describe how to run the application in a development environment using a locally built mifos.war.

1) Verify MySQL Services Are Running

Start up MySQL server either using the MySQL System Tray utility or by following the instructions below.

  1. Go to Control Panel-->Administrative Tools-->Services
  2. Scroll to MySQL.
  3. If the service is not running, start it.


2) Configure the Tomcat Installation with mifos.war

  1. Stop tomcat if it is running.
  2. Copy mifos.war from ..mifos\dist into the Tomcat /webapps/ directory.
  3. Start tomcat which deploys mifos.war.
  4. Check that tomcat is running - go  to  http://localhost:8080/manager/html. 

 

 3) Connect to Mifos

In a browser open:

http://localhost:8080/mifos

Username: mifos

Password: testmifos

If you are able to log into Mifos, you have correctly installed the application.  If you are not able to see the login page, you need to start troubleshooting.

 

last modified 2010-05-14 01:57
Grameen logo