Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Because this page is a compilation of sections from the Installation and Country Localisation wiki pages, please pay attention to the links that will open the single section that it refers to.

1. Web Application Installation

1.1 Procure Windows-based Server

Minimum requirements

The minimum requirement to install and use openIMIS in a production environment are: 

  • Windows Server 2016

  • 2 core CPU

  • 8 GB RAM

  • 100 GB Hard drive

  • Administrator privileges

You can acquire a VPS from any hosting provider (e.g. Azure, AWS) or create your own server backbone.

For development and testing purposes, please follow the minimum requirements on the following tools: 

1.2. Database installation

Install SQL Server

openIMIS has been developed and tested using SQL Server 2017. Newer or old versions might require adaptations to both these installation guide and openIMIS code.

  1. Download the desired version of SQL Server (for example, if you want to test openIMIS, you can download and install SQL Server 2017 Developer version - not for production (warning)).

  2. When the installation wizard opens, select the manual configuration option in order to fine-tune the installation process.

  3. On the Features selection:

    1. In Shared Feature section, select SQL Client Connectivity SDK

    2. For installations with Data Warehouse, select Analysis Services, Reporting Services and Integration Services (not available for the Express edition)

  4. On the Instance configuration, the default name SQLEXPRESS can be used, unless it is already used by another instance.

  5. On Database engine configuration, select Mixed Mode (SQL Server authentication and Windows authentication) in Authentication Mode.

  6. Continue the setup process until the installation is complete.

Configure SQL Server

  1. Open the SQL Server Configuration Manager

    1. On the left panel, select SQL Server Network ConfigurationProtocols for SQLEXPRESS (or the name of your SQL Server instance) → Enable Named Pipes and TCP/IP

    2. Select SQL Server Services → right-click on SQL Server instance name and select Restart

Initialize openIMIS database

To facilitate the setting up of the openIMIS database, we suggest installing SQL Server Management Studio (SSMS). The following procedure is based on SSMS, but you can use the standard SQL Server prompt to proceed with the setup.

  1. First, download the openIMIS database SQL files and migration scripts from Github repository (the source code ZIP file).

  2. If you wish to initialize the database using SSMS, follow the steps: 

    1. Create a new database for the openIMIS instance (e.g. openIMIS.1.4.0, where 1.4.0 is the openIMIS database version).

    2. Open the openIMIS_ONLINE.sql file (from the Empty databases folder) and execute the script (make sure the selected database is the one created in step a.)

  3. If you prefer to initialize the database using the shell:

    1. Be careful to adapt the queries to your setup, in the command lines example those assumptions were made:

      1. The database is called IMIS_DATABASENAME

      2. The SQL server is called SQL_Server_Name

    2. Run the following commands:

      SqlCmd -E –Q "CREATE DATABASE IMIS_DATABASENAME" 
      SqlCmd -E -S SQL_Server_Name -d IMIS_DATABASENAME –i X:\PathToSQLFile\openIMIS_ONLINE.sql
  4. Create a dedicated user with full privilege on the openIMIS database only:

    1. In the Security Logins → right-click and select “New Login…

    2. In General page:

      1. Give a login name (e.g. ImisUser)

      2. Select SQL Server authentication and provide a password

      3. Unselect Enforce password expiration

      4. Change the default database to openIMIS

    3. In User Mapping page:

      1. Map openIMIS database to ImisUser user

      2. Give the role of db_owner

Initialize specific openIMIS database

There are three specific openIMIS databases to chose from:

  • Offline (openIMIS_OFFLINE.sql): this mode is used for remote insurance offices without Internet connectivity. Note: the synchronization of data with the central server is manual.

  • Offline HF (openIMIS_OFFLINE_HF.sql): this mode can be used in remote health facilities without Internet connectivity. Note: the synchronization of data with the central server is manual.

  • Demo (openIMIS_demo_ONLINE.sql): this script initialize the empty database with the demo dataset.

To initialize one of the specific openIMIS databases, follow the steps:

  1. Initialize the openIMIS database by following the previous section steps

  2. Run the specific database script on the already initialized openIMIS database

Upgrade the openIMIS database

The upgrading process should always be performed on a copy of the database to ensure the proper execution of the migration script. In case of any issue arriving from the upgrading process, you can get back to the previous version of the database. Please report using openIMIS Service Desk any issue you may face in the upgrading process.

The upgrade can be done with SQL Server Management Studio (SSMS) or from the shell (be careful to adapt the querries to your setup).

To update a production instance and to prevent impacting the production if the migration script failed because of customizations in your openIMIS instance:

  1. During the upgrade make sure the is not reachable from the applications (you should stop the openIMIS website in Web Application IIS).

  2. Duplicate the database using SSMS or shell (create a full backup of the database and restore it with another database name, e.g. openIMIS.1.4.0)

    1. Shell commands (e.g. duplicate 'openIMIS.1.3.0' database to 'openIMIS.1.4.0' database; please adapt to your situation):

      SqlCmd -E -S SQL_Server_Name –Q "BACKUP DATABASE [openIMIS.1.3.0] TO DISK='X:\PathToBackupLocation\openIMIS.1.3.0.bak'" 
      SqlCmd -E -S SQL_Server_Name –Q "RESTORE DATABASE [openIMIS.1.4.0] FROM DISK='X:\PathToBackupLocation\openIMIS.1.3.0.bak' WITH MOVE 'openIMIS.1.3.0' TO 'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\openIMIS.1.4.0.mdf', MOVE 'openIMIS.1.3.0_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\openIMIS.1.4.0_log.ldf'"
  3. Download the openIMIS database SQL files and migration scripts from Github repository (the source code ZIP file).

  4. Execute the migration script on the copy of the database in SSMS or shell

    1. Shell command (e.g. from the current version 1.3.0 to the new version 1.4.0)

      SqlCmd -E -S SQL_Server_Name -d openIMIS.1.4.0 –i "X:\PathToMigrationScript\openIMIS migration v1.3.0 - v1.4.0.sql" 
  5. Configure the openIMIS Web Application to use the newly migrated database (e.g. openIMIS.1.4.0).

  6. Configure the openIMIS Backup Windows Service or your own backup application/service to use the newly migrated database (e.g. openIMIS.1.4.0).

  7. Start your openIMIS website.

1.3. Web Application installation

Install IIS

In Windows Server, follow these steps to install IIS:

  1. In the Server ManagerDashboard Add Roles and Features

  2. Select Role-based or feature-based installation

  3. Select your server from the server pool, and select your server from the list

  4. In Server Roles → select Web Server (IIS)Add Features

  5. In Features

    1. Select .NET Framework 3.5

    2. Select .NET Framework 4.6 and ASP.NET 4.6 (or later)

  6. In Web Server Role (IIS)Role Services

    1. In Web Server, ensure that Common HTTP FeaturesStatic Content is ticked

    2. In Application Development, select .NET Extensibility, ASP, ASP.NET, ISAPI Extensions, ISAPI Filters and Websocket Protocol

    3. In Management tools, tick all boxes

  7. Click on Install and wait for the features to be installed

  8. Restart the server if required

Download openIMIS Web Application

Download and unzip the release from Github web_app_vb repository into a new folder under the IIS wwwroot (e.g. C:\inetpub\wwwroot\openIMIS.1.4.0).

Configure IIS 

The configuration of IIS done through Internet Information Service (IIS) Manager.

Add a site

In Internet Information Service (IIS) Manager:

  1. Select your server name → Sites

  2. Remove the Default Web Site (if new installation)

  3. Right-click on SitesAdd Website

  4. Enter a site name for your openIMIS instance (e.g. openIMIS.1.4.0)

  5. Enter or select the physical pathname (e.g. C:\inetpub\wwwroot\openIMIS.1.4.0)

  6. If you have an SSL certificate, select binding type to HTTPS (port 443) and select your certificate

  7. If you don't have an SSL certificate, select binding type to HTTP (port 80)

If you have selected the binding type to HTTPS (port 443), then you will have to add also the binding type for HTTP

  1. Right-click on the new added website

  2. Select Edit Bindings

  3. Select binding type HTTP (port 80) and click ok

If you have a DNS address (e.g. demo.openimis.org) that is mapped to your server IP address, you can add it in the site binding configuration as the hostname. This will allow having multiple Sites deserving same ports (80 and 443) and can be used to have, for example, openIMIS development (e.g. dev.openimis.org) and production (e.g. demo.openimis.org) sites on the same server. 

Globalisation

Depending on the server’s initial configuration, the date format may differ from the expected DD/mm/YYYY format. To force the date format, go to the openIMIS site, then select Culture.NET Globalisation, and select English (United Kingdom) (en-GB) as a culture.

Configure openIMIS Web Application

Edit the web.config 

The web.config provides the configuration for openIMIS Web Application, including database connection string and necessary folders.

To configure the database connection string, go in openIMIS root folder (e.g. C:\inetpub\wwwroot\openIMIS.1.4.0), locate the web.config file and edit IMISConnectionString entry so that the connection string points to the database created in openIMIS database section with the right credentials. For example:

<connectionStrings>
    <add name="IMISConnectionString" connectionString="Data Source=WIN-H4E4ARREBFH\SQLEXPRESS;Initial Catalog=openIMIS.1.4.0;User ID=ImisUser;Password=password1234" providerName="System.Data.SqlClient" />
</connectionStrings>

Other configuration settings can be found within the <appSettings> tag and should be modified with caution.

Assign permission to source folders

In openIMIS root folder (e.g. C:\inetpub\wwwroot\openIMIS.1.6.0), IIS_IUSRS need to be given full control of the following folders: Archive, Extracts, FromPhone, Images, Workspace.

Repeat the following steps for each folder listed above:

  1. Right-click on the folder and select properties

  2. Ensure that the folder is not read-only

  3. Select the Security tab

  4. Click on Edit

  5. Select IIS_IUSRS and allow full control (in the below section).

  6. Then apply and click OK.

This can also be done automatically for all the above mentioned folders by running the provided set_folders_rights.ps1 script from a PowerShell console with Administrator rights (right click on PowerShell shortcut and select Run as administrator.

Edit permissions to Windows event logs

Click on the Windows Start menu of run Regedit via the search box:

  1. In the Registry Editor, select HKEY_LOCAL_MACHINESystemCurrentControlSetServicesEventlog.

  2. Right-click on the EventLog node, select Permission. Give full permissions to IIS_IUSRS, as described in the above paragraph (Assign permission to source folders). If the IIS_IUSRS user is not present in the list, then click Add button to add it manually. 

  3. Now repeat the same steps for EventlogSecurity and EventlogState node, as it can be required depending on the server’s environment.

Additional resources:

Open the application

Open your Internet browser and type the following URL in the browser address bar: http://localhost/

You can connect with the following credentials:

If you have initiated the openIMIS Blank Database:

  • Login name: Admin

  • Password: Admin

If you have initiated the openIMIS Demo Database:

  • Login name: Admin

  • Password: admin123

1.4. Windows Services installation

The following Windows Services are available: 

  • Policy Renewal service: periodically marks the policies that will expire in the near future to be renewed and updates the status of the already expired policies The openIMIS Windows Services are helping with the periodic activities which are required by the implementations. 

  • Backup service: periodically creates a backup of the database 

Install Windows Services

To install the Windows Service, proceed as follows for each Service:

  1. Download and unzip the installation setup from the links mentioned in the available Services

  2. Double click on the setup file

  3. Select the installation path (for example C:\Program Files\openIMIS\Windows Services), and click Next

  4. Close after the installation completes

The installed Service should start automatically as indicated in the system tray. If not, browse to Programs menu and search for the Service name (the controller of the service) and execute it.

Fix broken services 

To fix initial configuration files:

  1. Run IMIS Policy Renewal (if an error window appears, click Continue)

  2. Right-click the Policy Renewal icon in the system tray (lower-right corner of Windows) and click Settings

  3. Fill the newly-created window Imis Renewal Policy as follows (please adapt to your situation):

    1. Server: .\SERVERNAME

    2. Database: openIMIS.1.3.0 

    3. User Name: ImisUser

    4. Password: Pa$$w0rd

    5. Time: 00:00

    6. Interval: 24

    7. Untick all Send SMS to... options

    8. Click Apply

  4. Make a copy of the file ImisPolicyRenewal.exe.config inside C:\Program Files\openIMIS\Windows Services within the same folder

  5. Rename the copy into ImisBackup.exe.config

To fix service startup:

  1. Run Services

  2. Locate ImisBackup and ImisPolicyRenewal, and do the following for each:

    1. Double-click the said entry

    2. Click the Log On tab

    3. Select the Local System account option

    4. Tick the Allow service to interact with desktop checkbox

    5. Click OK

    6. Right-click the said entry

    7. Click either Restart or Start (whichever is possible)

    8. Locate its icon in the system tray (lower-right corner of Windows)

    9. Right-click the said icon and click Settings

    10. Fix field values, if needed

Configure the ImisPolicyRenewal Windows Service

This service is used to update insurance policies and runs every day at the specified time. It will do the following actions:

  1. If it finds a policy which is about to expire within a specified period of time, it flags it as to be renewed. The list of policies to be renewed can be used by the Enrolment Officers to contact the concerned families. The default policy expiring period of time is 14 days.

  2. Sets the policy status to expired to all policies that have expired in between this Service runs.

  3. Sends SMS to insuree if their policy is about to expire so that they can renew the policy (optional).

After the service installation, the user has to set the name of the server, the database name, the SQL-server instance credentials, and the service schedule for checking which policy is to be flagged as expired policy.

The days specified before the exact policy expiry date is provided in the table tblIMISDefaults under openIMIS Live database. The figure below shows the interface for policy renewal service.

openIMIS Policy Renewal Service configuration interface

Under the SMS gateway setting, you need to specify the URL given by SMS Gateway provider. You also need to provide the username and password to allow the service to send SMS to the insuree. 

Configure the ImisBackup Windows Service

This service is used for database backup, after the service installation, the user has to set the name of the server, the database name, the SQL-server instance credentials, and the service schedule for the backups.

The backup location is specified in the table tblIMISDefaults under openIMIS Live database. The figure below shows the interface for the database backup service.

openIMIS Backup Service configuration interface

  • No labels