wicket:
request-cycle:
timeout: 60s # specifies timeout for wicket page rendering
Using midPoint with Embedded Tomcat
This guide explains how to configure and run MidPoint with an embedded Tomcat. This feature is based on Spring libraries, especially the Spring Boot framework.
Configuration
MidPoint configuration is done in the config.xml
file located in midpoint.home
.
An embedded Tomcat can be configured in two places:
-
Default configuration file
application.yml
which is located at the following classpath:admin-gui/src/main/resources
folder. -
Custom configuration file
application.yml
which can be placed into themidpoint.home
folder.
The values can also be overwritten as a JVM argument (-Dxxx before application). For this purpose, the JAVA_OPTS variable or MP_SET_ variables can be used (see Start script).
You can also pass the values as application arguments (--xxx after application). See examples.
The list of available properties is based on Spring Boot configuration options and can be found in Spring Boot documentation.
Custom Configuration Items
Configuration Example 1
This example utilizes the processing of the MP_SET_* environment variables in the Start script. The result is a list of the -D parameters (as in example 2). The benefit of this approach is that the options can be handled as one property per one variable.
The primary target is for the containerized environment, i.e. Docker, Kubernetes (cloud).
MP_SET_server_port=8088 MP_SET_server_servlet_session_timeout=60m /opt/midpoint/bin/midpoint.sh start
It can also be used to generate a systemd service with -Dxxx parameters. For details, see Start script.
MP_SET_server_port=8088 MP_SET_server_servlet_session_timeout=60m /opt/midpoint/bin/midpoint.sh generate
Configuration Example 2
This is the native way to overwrite values, i.e. to set them without editing the configuration files.
java -Dserver.port=8088 -Dserver.servlet.session.timeout=60m [<other parameters>] -Dmidpoint.home=/opt/midpoint-home -jar midpoint.war
java [<other parameters>] -Dmidpoint.home=/opt/midpoint-home -jar midpoint.war --server.port=8088 --server.servlet.session.timeout=60m
Configuration Example 3
server.port: 8088
server.servlet.session.timeout: 60m
server:
port: 8088
servlet:
session:
timeout: 60m
(TODO: suffix "m" does not work - should be updated!)
Other Configuration
-
Banner (midPoint logo in logs)
-
Using the standard Spring Boot
banner.txt
file.
-
-
Static files moved to
src/main/resources/static
(default for Spring Boot)
JDBC Drivers
Currently, midPoint bundles only the PostgreSQL JDBC driver.
If you want to deploy a standalone midPoint with a different database, then the JDBC driver must be copied to midpoint.home/lib
.
Executable Jar Start/Stop
See an example command with minimum options (memory and midpoint.home
configuration) using midpoint.war
from the dist/target
folder:
java -Xms768m -Xmx2048m -Dmidpoint.home=/opt/midpoint-home -Dmidpoint.nodeId=node1 -jar midpoint.war
Other options can be added using the -D
option, e.g. -Dserver.port=12345
.
The options stated explicitly in the command will override defaults located in midpoint.home
/application.yml.
Using midPoint with Embedded Tomcat
Use the default URL (modify hostname and port as required): http://localhost:8080/
Autoconfiguration
The midPoint web application is autoconfigured by using the com.evolveum.midpoint.web.boot.MidPointSpringApplication
class as a starting point.
Spring boot will process all the annotated methods of this class using the "configuration code" approach.
Additional autoconfiguration classes are also used and they are listed in the @ImportAutoConfiguration
annotation.
Autoconfiguration is used as a replacement for JEE deployment descriptor (web.xml). E.g. servlets and servlet mappings are initialized in the MidPointSpringApplication class.
SSL Configuration
When using an Embedded Tomcat, you can configure SSL in the application.yml
file.
server:
ssl:
enabled: true
keyStoreType: PKCS12
key-store: /pathToCertificate/certificate.p12
key-store-password: password
This is a basic example, however, you can use other configuration variables.
See also how to configure SSL in Spring Boot.
If you are using an untrusted certificate, e.g. self-signed, in addition to referencing it in the keystore, you also need to import it to the trust store. |