Skip to content

Latest commit

 

History

History
117 lines (67 loc) · 3.91 KB

INSTALL_GUIDE.md

File metadata and controls

117 lines (67 loc) · 3.91 KB

Install guide

Table of Contents

  1. Obtaining the source code
  2. Building project
  3. Installing Glassfish
  4. Preparing the database
  5. Deploying the project

Obtaining the source code

  1. Install git
  2. Run your command line, change directory to the location where you will be building the project (I will be using the directoryD:\forks\build and run the following commands:
git clone https://github.com/hmislk/hmis.git

Building project

You need to have installed JDK 8+ and Maven on your server to complete this step.

Now, to build the project, run:

cd hmis
mvn package

After the successful build you will see the absolute path of the built war file, for example:

[INFO] Building war: D:\forks\build\hmis\target\arogya2022-3.0.0.war

Installing Payara Server

You need to have JDK 11 on your server for this step

Payara server verison 5.2022.5 is the highest tested version and therefore it is recommended.

You can download it here.

Download .zip file and extract it where you want your server files to be, for example into D:\Payara

Edit file D:Payara\payara5\glassfish\config\asenv.bat and add following line:

set AS_JAVA=<JDK location>

In my case:

set AS_JAVA=D:\JAVA\jdk-11.0.25

Make sure the port 8080 is not being used on your server.

In your command line, change directory to <PAYARA_HOME>/bin and run:

asadmin start-domain domain1

After launch, your can open the Payara admin console in your browser: localhost:4848

Preparing the database

I assume you have a MySQL server instance running somewhere, I will be using the MySQL instance running on the same machine.

You need to create an empty database (named hmis) and a user with appropriate privileges to access it (username/password both as hmis/hmis in my case).

After that you need to download JDBC driver jar file, for example, here, and put into your D:\Payara\payara5\glassfish\lib folder, in my case the path is like that:

D:\Payara\payara5\glassfish\lib\mysql-connector-java-8.0.30.jar

Now, restart the Glassfish:

D:\Payara\payara5\bin\asadmin stop-domain domain1

D:\Payara\payara5\bin\asadmin start-domain domain1

Open Payara admin console and create a new JDBC Connection Pool with settings like these:

pic1

pic2

Change username/password as needed.

You need to make sure that test connection to your database is working (Ping button to the left).

pic 3

If not, I can recommend to copy the file mysql-connector-java-8.0.30.jar into directory <PAYARA_HOME>\glassfish\lib.

Restart the Payara server and try again.

After creating the connection pool resource, you need to create the JNDI resource jdbc/Ruhunu as follows:

pic 4

Now you're ready to deploy the project and the tables in your database will be created automatically.

Deploying the project

Simply run the command:

<PAYARA_HOME>\bin\asadmin deploy <built war file path>

In my case:

D:\Payara\payara5\bin\asadmin deploy D:\forks\build\hmis\target\arogya2022-3.0.0.war

When deploying is done, you can open the page http://localhost:8080/arogya2022/ in your browser, create your first institution/user

pic 5

and you're ready to go!

pic 6

Troubleshooting

  • I can't access admin pages anymore after creating the first user (which is password/login for the super user?)