Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Usually this comes installed with your default Mac OS. You can verify this by typing the following command in the terminal.

brew
$ brew --version

You should expect something similar to the output below - else install and upgrade brew here https://brew.sh/

...

Check how many java versions installed

$ /usr/libexec/java_home -V 

Switch between Java X and Java 8 (the latter installed above) by adding this to your .bash_profile  and running source ~/.bash_profile afterwards

# Java 8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home


Insatlling Installing Java 8 using brew :

Similarly you can install java using brew by typing the following commands into a terminal and switching the default java version as stated above

$ brew cask install java
$ brew tap caskroom/versions
$ brew cask install java8

Install mysql-server : (Only version 5.5 or version 5.6)

...

You should consider adding alias for running mysql and mysqladmin commands via terminal. See below

$ alias mysql=/usr/local/mysql/bin/mysql 
$ alias mysqladmin=/usr/local/mysql/bin/mysqladmin


Install tomact tomcat : 

Download and install the core binary from the original website here https://tomcat.apache.org/download-70.cgi 
  • Unzip the file downloaded
  • Run the following commands. 
$ sudo mkdir -p /Library/Tomcat

$ sudo mv ~/PATH-TO-UNZIPED-TOMCAT/apache-tomcat-7.X.XX /Library/Tomcat

  • Make all scripts executable
$ sudo chmod +x /Library/Tomcat/apache-tomcat-7.X.XX/bin/*.sh 
  • Starting Tomcat
$ sudo ./Library/Tomcat/apache-tomcat-7.X.XX/bin/startup.sh 
After starting Tomcat server you can visit http://localhost:8080 on a web browser and observe the following screen
Image Modified
  • Stoping
    Stopping Tomcat
$ sudo ./Library/Tomcat/apache-tomcat-7.X.XX/bin/shutdown.sh 
Step 2 - Tomcat setup
Enabling SSL
To enable tomcat SSL (https), generate and store a key:
$ sudo keytool -genkey -keyalg RSA -alias tomcat -keystore /usr/share/tomcat.keystore
set password to: xyz123
(Bad for security, but just to get all installed and instructions on how to change it will be provided later in this guide)
This gets stored in /usr/share/tomcat7 as tomcat.keystore
 
Updating server.xml configuration file
It is located at /Library/Tomcat/apache-tomcat-7.x.xx/conf/server.xml path
$ sudo nano /Library/Tomcat/apache-tomcat-7.x.xx/conf/server.xml

Info
titlenano shortcut keys
Tip: To delete line by line you could use ctrl+k
To exit you could use ctrl+x
To confirm say yes & you could use y
then click on enter button to save
copy and replace below content into it
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<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="org.drizzle.jdbc.DrizzleDriver"
url="jdbc:mysql:thin://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>
<Service name="Catalina"> 
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
port="443" maxThreads="200" scheme="https"
secure="true" SSLEnabled="true"
keystoreFile="/usr/share/tomcat.keystore"
keystorePass="xyz123"
clientAuth="false" sslProtocol="TLS"
URIEncoding="UTF-8"
compression="force"
compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
</Service>
</Server>

Info
titleNote:
If your any of the server port connections are using port number = 443, then you need to change your port number to 8443, in server.xml here:-
port="443" maxThreads="200" scheme="https" to port="8443" maxThreads="200" scheme="https" 
 
Download drizzle jdbc connector
Place it under lib folder 
$ cd /Library/Tomcat/apache-tomcat-7.x.xx/lib
$ sudo wget http://central.maven.org/maven2/org/drizzle/jdbc/drizzle-jdbc/1.3/drizzle-jdbc-1.3.jar
Step 3 - Fineract Platform and Database Setup/Population
Initialize Fineract Platform Database(s) 
$ mysql -u root -p
Enter mysql root password, and in mysql console type: 
$ create database `mifosplatform-tenants`;
$ create database `mifostenant-default`;
$ exit 

Optional - If you want to load sample data, otherwise you could skip this part: 

# mysql -u root -p mifostenant-default < fineract-provider/src/main/resources/sql/migrations/sample_data/load_sample_data.sql