OpenRIMS-RPM - Installation Part 3: Difference between revisions

From OpenRIMS Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:


== Install as a service ==
== Install as a service ==
              For Linux the official guide is here <nowiki>https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d</nowiki>
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 <nowiki>https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services</nowiki>
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. The folders are “windows” and “Linux”.
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 ==
== 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”.
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 =
= IIS as a gateway for Spring Boot application =
Line 17: Line 15:


== Special configurations ==
== Special configurations ==
<nowiki>https://serverfault.com/questions/936922/setting-up-iis-reverse-proxy-to-preserve-host-headers</nowiki>
https://serverfault.com/questions/936922/setting-up-iis-reverse-proxy-to-preserve-host-headers


== Example of web.config for the default IIS site ==
== Example of web.config for the default IIS site ==
Line 155: Line 153:


</configuration>
</configuration>
----[1] The theory is here <nowiki>https://developers.google.com/identity/protocols/oauth2</nowiki> The Pharmadex 2 uses the web-server applications scenario.
----[1] The theory is here https://developers.google.com/identity/protocols/oauth2. OpenRIMS uses the web-server applications scenario.

Revision as of 20:10, 14 August 2023

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.