OpenRIMS-RPM - Installation Part 3
Install as a service
For Linux the official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d
For Windows the official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services
Examples of the configurations are in the binary distributive on https://github.com/MSH/OpenRIMS/tree/main/bin. The folders are “windows” and “linux”.
Provide access from the Internet
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2. The example of virtual server configuration for Apache 2 is in the binary distributive, folder “Linux”.
IIS as a gateway for Spring Boot application
Redirect rules, URL rewrite module
Special configurations
https://serverfault.com/questions/936922/setting-up-iis-reverse-proxy-to-preserve-host-headers
Example of web.config for the default IIS site
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy to www.pharmadexmz.org/mozambique" stopProcessing="true">
<match url="mozambique/.*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/{R:0}" />
</rule>
<rule name="Reverse Proxy to www.pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/mozambique/{R:0}" />
</rule>
<rule name="Reverse Proxy to pharmadexmz.org/mozambique" stopProcessing="true">
<match url="mozambique/.*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/{R:0}" />
</rule>
<rule name="Reverse Proxy to pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8081/mozambique/{R:0}" />
</rule>
<rule name="Reverse Proxy to eperm.pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^eperm.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8082/{R:0}" />
</rule>
<rule name="Reverse Proxy to anarme.pharmadexmz.org" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^anarme.pharmadexmz.org$" />
</conditions>
<action type="Rewrite" url="http://localhost:8083/{R:0}" />
</rule>
<rule name="PViMS HTTP to HTTPS Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="WWW Server" areas="Rewrite" verbosity="Verbose" />
</traceAreas>
<failureDefinitions timeTaken="00:00:00" statusCodes="404, 500" />
</add>
</traceFailedRequests>
</tracing>
</system.webServer>
</configuration>
[1] The theory is here https://developers.google.com/identity/protocols/oauth2. OpenRIMS uses the web-server applications scenario.