Ubuntu Server 12.04 Mifos 1.23.1 & Community app Install Guide/HOWTO

quick note:  I wanted to take this opportunity to express my gratitude to 
Mifos developers and community. Simply put, you guy are changing the world 
by making it better. Thank you.


Become root:
# sudo -s

-- INSTALL PREREQUISITES  (java 7, tomcat7, mysql-server)
# apt-get update
# apt-get upgrade
# apt-get install openjdk-7-jdk mysql-server tomcat7 
*set mysql root password to: mysql  
(i know, bad for security, but just to get it installed and instructions on 
how to change it will be provided later in this guide)  


-- OPTIONAL (nano text editor - just in case you don't have a favorite one 
yet)
-- # apt-get install  nano
--
-- Check date:
-- # date
-- and if needed update with
-- # dpkg-reconfigure tzdata


ENABLE TOMCAT SSL (https)  (thanks to/more details @ 
http://tkurek.blogspot.tw/2013/07/how-to-secure-tomcat-7-with-ssl-tls.html)
# keytool -genkey -keyalg RSA -alias tomcat -keystore 
/etc/tomcat7/keystore.jks -storepass keystore -validity 360 -keysize 2048 

Update /etc/tomcat7/server.xml configuration file 

after
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               URIEncoding="UTF-8"
               redirectPort="8443" />

add

<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
           port="8443" SSLEnabled="true" maxThreads="200"
           scheme="https" secure="true"
           keystoreFile="/etc/tomcat7/keystore.jks"
           keystorePass="keystore" clientAuth="false"
           sslProtocol="TLS" />


# /etc/init.d/tomcat7 restart
( visit https://yourip_or_localhost:8443/   to confirm ssl/tomcat working)


-- Download Mifosplatform -mifosplatform-1.23.1.RELEASE.zip (if wget below 
fails, get a working link here 
http://sourceforge.net/projects/mifos/files/Mifos%20X/ )
# cd /usr/src
# wget 
http://downloads.sourceforge.net/project/mifos/Mifos%20X/mifosplatform-1.23.1.RELEASE.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmifos%2Ffiles%2FMifos%2520X%2F&ts=1403225973&use_mirror=softlayer-dal
# mv 
mifosplatform-1.23.1.RELEASE.zip\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmifos%2Ffiles%2FMifos%20X%2F
  
mifos.zip
# unzip mifos.zip 
# cd mifosplatform-1.23.1.RELEASE

-- INSTALL/POPULATE DATABASE   (more at  
https://github.com/openMF/mifosx/blob/master/INSTALL.md )
# mysql -uroot -pmysql
-In mysql console type:
create database `mifosplatform-tenants`;
exit

# mysql -uroot -pmysql mifosplatform-tenants < 
database/mifospltaform-tenants-first-time-install.sql

# mysql -uroot -pmysql
-In mysql console type:
create database `mifostenant-default`;
exit

# mysql -uroot -pmysql mifostenant-default < 
database/migrations/sample_data/load_sample_data.sql

Add database info to tomcat config
# nano /etc/tomcat7/server.xml


 <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />


<Resource type="javax.sql.DataSource"
            name="jdbc/mifosplatform-tenants"
            factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/mifosplatform-tenants"
            username="root"
            password="mysql"
            initialSize="3"
            maxActive="10"
            maxIdle="6"
            minIdle="3"
            validationQuery="SELECT 1"
            testOnBorrow="true"
            testOnReturn="true"
            testWhileIdle="true"
            timeBetweenEvictionRunsMillis="30000"
            minEvictableIdleTimeMillis="60000"
            logAbandoned="true"
            suspectTimeout="60"
       />
  </GlobalNamingResources>



Almost there! Copy Mifos to Tomcat web folders

# cd /usr/src/mifosplatform-1.23.1.RELEASE
cp mifosng-provider.war /var/lib/tomcat7/webapps/
cp -r api-docs/ /var/lib/tomcat7/webapps/ROOT/
cp -r apps/community-app/ /var/lib/tomcat7/webapps/ROOT/
cp -r api-docs/ /var/lib/tomcat7/webapps/ROOT/

and at last
# /etc/init.d/tomcat7 restart

Watch your Mifos come to life .... or fail here:
# tail -f /var/lib/tomcat7/logs/mifos-platform.log
(if all ok, you should see sometihng like: Root WebApplicationContext: 
initialization completed in 45876 ms)


so now, 
Platform application should be available @ https://[server ip 
address]:8443/mifosng-provider/api/v1/offices?tenantIdentifier=default&pretty=true
Community application should be available @ https://[server ip 
address]:8443/community-app?baseApiUrl=https://[server ip 
address]:8443/mifosng-provider/api/v1/

BAM! 


EXTRAS:
Change Mifos default mysql password:

# apt-get install phpmyadmin

1.  Go to   http://yourserver/phpmyadmin  and login

2.  Click on Privileges, then Add a new User

3. Pick a username/password and create it. Assign full privileges globally, 
or on  mifosplatform-tenants &  mifostenant-default databases.

4. On the left, select/open mifosplatform-tenants database,
you should see a table with a single column , click "edit" in front of it.

Locate:
schema_username 
schema_password 

And set user/pass created in step #3.

Finally, edit 

/etc/tomcat7/server.xml
username="root"
password="mysql"

And set user/pass created in step #3 here as well.

You can now set new mysql root password, without braking mifos.

Restart tomcat, you done. 

# /etc/init.d/tomcat7 restart














-- 
You received this message because you are subscribed to the Google Groups 
"Mifos Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mifosdeveloper.
For more options, visit https://groups.google.com/d/optout.

Reply via email to