On Ubuntu 10.04 LTS (Using AMI ami-923575c0)
1 Ubuntu Environment Setup
This section explains the basic environment setup for Ubuntu.
These Installations are a pre-requisite for Installing Mifos and Mifos BI
1.1 Update Server for any Patches
First we ensure that our Server is updated with all currently available patches
(Note: Always use LTS version of Ubuntu)
Command :-
sudo apt-get update
(This command gets the list of all available update packages)
sudo apt-get upgrade
(This command actually installs newer versions of the packages present)
1.2 Configure Timezone
Set the appropriate Time zone for the Ubuntu server (here we set the Time Zone to I.S.T)
Command :-
sudo dpkg-reconfigure tzdata
After being prompted to select Continent, choose “Asia” and then choose “Kolkata” for Country. Now, verify that the right timezone is set
Command :-
date
Similar data should be displayed.
user@ubuntu:~$ date
Wed Jun 20 10:20:46 IST 2012
user@ubuntu:~$
1.3 Install MySQL Server
Now, we go about Installing MySQL Server version 5.1
Command :-
sudo apt-get install mysql-server-5.1
Next, set the password when prompted, here we set the password to “password”.
Ensure you are able to login using the new password.
Command :-
mysql -u root -ppassword
Allow Remote Access {Optional}
This step is required if the application and the database are in two different servers
Command :- (to enable remote access)
sudo nano /etc/mysql/my.cnf
In this file,Replace “127.0.0.0” with “0.0.0.0”
Command :- (to grant rights remote access to a user)
grant all on *.* to ‘root’ identified by ‘password’;
Replace ‘root’ and ‘password’ with appropriate credentials.
Restart MySQL for changes to take effect.
Settings for MIFOS Bugs {Optional}
This setting is to resolve mifos database tables case sensitive issues
Command:-
sudo nano /etc/mysql/conf.d/mifos.cnf
Copy the following contents to the new file
[mysqld]
#due to issue 1513
lower_case_table_names = 1
# optional,but saves disk space
innodb_file_per_table
Restart MySQL for the changes to take effect.
Command:-
sudo restart mysql
1.4 Install JDK 6
Sun JDK is not available by default in Ubuntu repositories.
We have to add a partner repository for the same and then go about installing Sun JDK
Command :-
user@ubuntu:~$ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
user@ubuntu:~$
Java is installed successfully if the above lines are visible.
2 Mifos Installation
To install mifos,we need to download a server to deploy mifos application.
(Jetty 7.3.x is the recommended server)
(Download all the necessary files to your home directory)
(In this example,the home directory is “/home/ubuntu/”)
2.1 Install Jetty
Navigate to your home directory.
Command:-
cd ~
Download jetty server
Command: -
wget http://archive.eclipse.org/jetty/7.3.1.v20110307/dist/jetty-distribution-7.3.1.v20110307.zip
Before extracting,unzip package must be installed.
Command:-
sudo apt-get install unzip
Extract the jetty-distribution-7.3.1.v20110307.zip file in the home directory
Command:-
unzip jetty-distribution-7.3.1.v20110307.zip
2.2 Download Mifos
Get the latest stable version of Mifos
wget http://sourceforge.net/projects/mifos/files/latest/download
Now the file is downloaded as ‘download’ in the home directory.
Rename the file
Command:-
mv download mifos-v2.4.0.zip
Unzip mifos file.
Command:-
unzip mifos-v2.4.0.zip
2.3 Restore Database.
Next we restore the database for Mifos
Command:
//Navigate to the SQL files folder
cd /home/ubuntu/mifos-v2.4.0/db/sql
//Login to mysql and create database mifos
Command:-
mysql -u root -ppassword
create database mifos;
use mifos;
source base-schema.sql
source base-data.sql
source init_mifos_password.sql
2.4 Configure Local Settings.
We specify details of our Database including its credentials for Mifos.
Command:-
//create a folder called ".mifos" in the users home directory
cd /home/ubuntu
mkdir .mifos
//Here create a file called local.properties
Command:-
cd .mifos
touch local.properties
//Copy the following contents to this file
# settings used at build time and by a running/deployed Mifos instance
# (defaults are in mainDatabase.properties)
main.database=mifos main.database.host=localhost
#use the internal ip add of the database server if DB server is on a different box
#main.database.host=ip-10-130-18-69.ap-southeast-1.compute.internal main.database.port=3306
main.database.user=root
main.database.password=password
OR
//Navigate to the config folder in mifos-v2.4.0 directory.
Command:-
cd /home/ubuntu/mifos-v2.4.0/config
//Copy local.properties file to the .mifos folder.
sudo cp local.properties /home/ubuntu/.mifos
//Edit the copied local.properties file
sudo nano /home/ubuntu/.mifos/local.properties
Replace
# settings used at build time and by a running/deployed Mifos instance
# (defaults are in mainDatabase.properties)
main.database=mifos
main.database.host=localhost
main.database.port=3306
main.database.user=mifos
main.database.password=mifo
With
# settings used at build time and by a running/deployed Mifos instance
# (defaults are in mainDatabase.properties)
main.database=mifos
main.database.host=localhost
main.database.port=3306
main.database.user=root
main.database.password=password
2.5 Deploying Mifos.
Deployment means the process of copying Mifos war file to Jetty's deployment directory
(webapps) and starting Mifos
Command:-
//copy mifos.war file to Jetty deployment directory
cp /home/ubuntu/mifos-v2.4.0/mifos.war /home/ubuntu/jetty-distribution-7.3.1.v20110307/webapps
2.6 Configure Jetty.
Jetty supports JNDI, but by default it is disabled in a standard server.
In order to enable JNDI in Jetty a few changes to the start.ini file in Jetty home directory must be made:
Command:-
sudo nano /home/ubuntu/jetty-distribution-7.3.1.v20110307/start.ini
1) Add 'plus' and 'annotations' to OPTIONS, so that it looks something like this:
OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations
2) Enable the plus configuration by adding the following line:
etc/jetty-plus.xml
at the end of the file next to other similar entries.
That's it, Jetty should now support JNDI.
2.7 Starting mifos.
//Navigate to Jetty directory
Command:-
cd /home/ubuntu/jetty-distribution-7.3.1.v20110307
//Start mifos using the following command.
java -Xms768M -Xmx768M -XX:MaxPermSize=256m -jar start.jar
Once the server is started visit http://localhost:8080/mifos
Enter username and password as ‘mifos’ and ‘testmifos’ respectively.
1 Ubuntu Environment Setup
This section explains the basic environment setup for Ubuntu.
These Installations are a pre-requisite for Installing Mifos and Mifos BI
1.1 Update Server for any Patches
First we ensure that our Server is updated with all currently available patches
(Note: Always use LTS version of Ubuntu)
Command :-
sudo apt-get update
(This command gets the list of all available update packages)
sudo apt-get upgrade
(This command actually installs newer versions of the packages present)
1.2 Configure Timezone
Set the appropriate Time zone for the Ubuntu server (here we set the Time Zone to I.S.T)
Command :-
sudo dpkg-reconfigure tzdata
After being prompted to select Continent, choose “Asia” and then choose “Kolkata” for Country. Now, verify that the right timezone is set
Command :-
date
Similar data should be displayed.
user@ubuntu:~$ date
Wed Jun 20 10:20:46 IST 2012
user@ubuntu:~$
1.3 Install MySQL Server
Now, we go about Installing MySQL Server version 5.1
Command :-
sudo apt-get install mysql-server-5.1
Next, set the password when prompted, here we set the password to “password”.
Ensure you are able to login using the new password.
Command :-
mysql -u root -ppassword
Allow Remote Access {Optional}
This step is required if the application and the database are in two different servers
Command :- (to enable remote access)
sudo nano /etc/mysql/my.cnf
In this file,Replace “127.0.0.0” with “0.0.0.0”
Command :- (to grant rights remote access to a user)
grant all on *.* to ‘root’ identified by ‘password’;
Replace ‘root’ and ‘password’ with appropriate credentials.
Restart MySQL for changes to take effect.
Settings for MIFOS Bugs {Optional}
This setting is to resolve mifos database tables case sensitive issues
Command:-
sudo nano /etc/mysql/conf.d/mifos.cnf
Copy the following contents to the new file
[mysqld]
#due to issue 1513
lower_case_table_names = 1
# optional,but saves disk space
innodb_file_per_table
Restart MySQL for the changes to take effect.
Command:-
sudo restart mysql
1.4 Install JDK 6
Sun JDK is not available by default in Ubuntu repositories.
We have to add a partner repository for the same and then go about installing Sun JDK
Command :-
- Remove any openjdk packages: sudo apt-get purge openjdk*
- Add this PPA to your system: sudo apt-add-repository ppa:flexiondotorg/java
- Update: sudo apt-get update
- Installjava 6 packages: sudo apt-get install sun-java6-jre sun-java6-jdk
- Test the java version: java -version
user@ubuntu:~$ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
user@ubuntu:~$
Java is installed successfully if the above lines are visible.
2 Mifos Installation
To install mifos,we need to download a server to deploy mifos application.
(Jetty 7.3.x is the recommended server)
(Download all the necessary files to your home directory)
(In this example,the home directory is “/home/ubuntu/”)
2.1 Install Jetty
Navigate to your home directory.
Command:-
cd ~
Download jetty server
Command: -
wget http://archive.eclipse.org/jetty/7.3.1.v20110307/dist/jetty-distribution-7.3.1.v20110307.zip
Before extracting,unzip package must be installed.
Command:-
sudo apt-get install unzip
Extract the jetty-distribution-7.3.1.v20110307.zip file in the home directory
Command:-
unzip jetty-distribution-7.3.1.v20110307.zip
2.2 Download Mifos
Get the latest stable version of Mifos
wget http://sourceforge.net/projects/mifos/files/latest/download
Now the file is downloaded as ‘download’ in the home directory.
Rename the file
Command:-
mv download mifos-v2.4.0.zip
Unzip mifos file.
Command:-
unzip mifos-v2.4.0.zip
2.3 Restore Database.
Next we restore the database for Mifos
Command:
//Navigate to the SQL files folder
cd /home/ubuntu/mifos-v2.4.0/db/sql
//Login to mysql and create database mifos
Command:-
mysql -u root -ppassword
create database mifos;
use mifos;
source base-schema.sql
source base-data.sql
source init_mifos_password.sql
2.4 Configure Local Settings.
We specify details of our Database including its credentials for Mifos.
Command:-
//create a folder called ".mifos" in the users home directory
cd /home/ubuntu
mkdir .mifos
//Here create a file called local.properties
Command:-
cd .mifos
touch local.properties
//Copy the following contents to this file
# settings used at build time and by a running/deployed Mifos instance
# (defaults are in mainDatabase.properties)
main.database=mifos main.database.host=localhost
#use the internal ip add of the database server if DB server is on a different box
#main.database.host=ip-10-130-18-69.ap-southeast-1.compute.internal main.database.port=3306
main.database.user=root
main.database.password=password
OR
//Navigate to the config folder in mifos-v2.4.0 directory.
Command:-
cd /home/ubuntu/mifos-v2.4.0/config
//Copy local.properties file to the .mifos folder.
sudo cp local.properties /home/ubuntu/.mifos
//Edit the copied local.properties file
sudo nano /home/ubuntu/.mifos/local.properties
Replace
# settings used at build time and by a running/deployed Mifos instance
# (defaults are in mainDatabase.properties)
main.database=mifos
main.database.host=localhost
main.database.port=3306
main.database.user=mifos
main.database.password=mifo
With
# settings used at build time and by a running/deployed Mifos instance
# (defaults are in mainDatabase.properties)
main.database=mifos
main.database.host=localhost
main.database.port=3306
main.database.user=root
main.database.password=password
2.5 Deploying Mifos.
Deployment means the process of copying Mifos war file to Jetty's deployment directory
(webapps) and starting Mifos
Command:-
//copy mifos.war file to Jetty deployment directory
cp /home/ubuntu/mifos-v2.4.0/mifos.war /home/ubuntu/jetty-distribution-7.3.1.v20110307/webapps
2.6 Configure Jetty.
Jetty supports JNDI, but by default it is disabled in a standard server.
In order to enable JNDI in Jetty a few changes to the start.ini file in Jetty home directory must be made:
Command:-
sudo nano /home/ubuntu/jetty-distribution-7.3.1.v20110307/start.ini
1) Add 'plus' and 'annotations' to OPTIONS, so that it looks something like this:
OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations
2) Enable the plus configuration by adding the following line:
etc/jetty-plus.xml
at the end of the file next to other similar entries.
That's it, Jetty should now support JNDI.
2.7 Starting mifos.
//Navigate to Jetty directory
Command:-
cd /home/ubuntu/jetty-distribution-7.3.1.v20110307
//Start mifos using the following command.
java -Xms768M -Xmx768M -XX:MaxPermSize=256m -jar start.jar
Once the server is started visit http://localhost:8080/mifos
Enter username and password as ‘mifos’ and ‘testmifos’ respectively.











RSS Feed