Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:czechidm_installation [2020/04/21 11:40] fiserp [1. Create DB user and database in PostgreSQL] |
tutorial:adm:czechidm_installation [2020/08/26 15:24] apeterova czech collation is default |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Installation of CzechIdM - Linux ====== | + | ====== Installation of CzechIdM - Linux - CentOS8 |
{{tag> | {{tag> | ||
- | We presume | + | We expect |
- | This tutorial shows how to install full production-ready version of CzechIdM on standard software setup (java, postgreSQL, Tomcat, Apache | + | This tutorial shows how to install full production-ready version of CzechIdM on standard software setup (Java, PostgreSQL, Tomcat, Apache |
- | <note tip>If you install CzechIdM on Sql server | + | <note tip>If you install CzechIdM on with Microsoft SQL Server database backend, |
==== 1. Create DB user and database in PostgreSQL ==== | ==== 1. Create DB user and database in PostgreSQL ==== | ||
Switch the user from root to postgres and use **psql** to add the user and database into PostgreSQL: | Switch the user from root to postgres and use **psql** to add the user and database into PostgreSQL: | ||
Line 17: | Line 17: | ||
# Choose appropriate collation and create database. | # Choose appropriate collation and create database. | ||
- | # with english | + | # with czech collation |
- | CREATE DATABASE " | + | |
- | # with czech collation | + | |
CREATE DATABASE " | CREATE DATABASE " | ||
+ | # or with english collation | ||
+ | # CREATE DATABASE " | ||
</ | </ | ||
Line 40: | Line 40: | ||
and restart PostgreSQL. | and restart PostgreSQL. | ||
</ | </ | ||
- | ==== 2. JDBC driver installation - CentOS7 | + | ==== 2. JDBC driver installation - CentOS8 |
**CentOS** | **CentOS** | ||
- | Install the package with PostgreSQL JDBC driver: | + | Download |
+ | In this example we download version 42.2.11. | ||
<code bash> | <code bash> | ||
- | yum install -y postgresql-jdbc | + | wget https:// |
</ | </ | ||
- | allow Tomcat to use the driver: | + | ==== 3. Configure environment properties. Select application profile ==== |
- | + | ||
- | <code bash> | + | |
- | ln -s / | + | |
- | </ | + | |
- | + | ||
- | ==== 3. JDBC driver installation - Debian ==== | + | |
- | + | ||
- | Install the package with PostgreSQL JDBC driver: | + | |
- | + | ||
- | <code bash> | + | |
- | apt-get install libpostgresql-jdbc-java | + | |
- | </ | + | |
- | + | ||
- | allow Tomcat to use the driver: | + | |
- | + | ||
- | <code bash> | + | |
- | ln -s / | + | |
- | </ | + | |
- | ==== 4. Configure environment properties. Select application profile ==== | + | |
Edit the configuration file ''/ | Edit the configuration file ''/ | ||
< | < | ||
- | <note important> | ||
- | < | ||
- | Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: | ||
- | </ | ||
Change the following line: | Change the following line: | ||
Line 84: | Line 62: | ||
into: | into: | ||
<code bash> | <code bash> | ||
- | Environment=' | + | Environment=' |
</ | </ | ||
Line 91: | Line 69: | ||
systemctl daemon-reload | systemctl daemon-reload | ||
</ | </ | ||
- | ==== 5. Create CzechIdM configuration folders ==== | + | ==== 4. Create CzechIdM configuration folders ==== |
In CzechIdM, you can store all deployment-specific configuration (i.e. database credentials) outside the war file. This is a configure-once approach which greatly simplifies future deployments. | In CzechIdM, you can store all deployment-specific configuration (i.e. database credentials) outside the war file. This is a configure-once approach which greatly simplifies future deployments. | ||
* The **etc** directory stores configuration files. | * The **etc** directory stores configuration files. | ||
Line 105: | Line 83: | ||
- | ==== 6. Create CzechIdM configuration ==== | + | ==== 5. Create CzechIdM configuration ==== |
Now we will create configuration files the CzechIdM will use. | Now we will create configuration files the CzechIdM will use. | ||
< | < | ||
- | * The **/ | + | * The **/ |
- | cat / | + | cat / |
</ | </ | ||
* The **/ | * The **/ | ||
Line 139: | Line 117: | ||
</ | </ | ||
- | < | + | < |
- | <logger name=" | + | |
- | <logger name=" | + | |
- | <logger name=" | + | |
- | <logger name=" | + | |
- | <logger name=" | + | |
- | </ | + | |
- | + | ||
- | < | + | |
< | < | ||
< | < | ||
Line 167: | Line 137: | ||
</ | </ | ||
- | <logger name=" | + | <logger name=" |
< | < | ||
</ | </ | ||
<logger name=" | <logger name=" | ||
- | <logger name=" | + | <logger name=" |
- | <logger name=" | + | <logger name=" |
- | <logger name=" | + | <logger name=" |
- | </ | + | |
- | < | ||
- | <logger name=" | ||
- | <logger name=" | ||
- | <logger name=" | ||
- | <logger name=" | ||
- | <logger name=" | ||
</ | </ | ||
+ | |||
</ | </ | ||
</ | </ | ||
Line 201: | Line 165: | ||
flyway.enabled=true | flyway.enabled=true | ||
- | + | ||
scheduler.properties.location=quartz-production.properties | scheduler.properties.location=quartz-production.properties | ||
- | + | ||
logging.config=/ | logging.config=/ | ||
- | + | ||
idm.sec.core.demo.data.enabled=false | idm.sec.core.demo.data.enabled=false | ||
- | + | ||
# attachments will be stored under this path. | # attachments will be stored under this path. | ||
# new directories for attachment will be created in this folder (permissions has to be added) | # new directories for attachment will be created in this folder (permissions has to be added) | ||
Line 214: | Line 178: | ||
# configuration property for default backup | # configuration property for default backup | ||
idm.sec.core.backups.default.folder.path=/ | idm.sec.core.backups.default.folder.path=/ | ||
- | + | ||
idm.pub.security.allowed-origins=http:// | idm.pub.security.allowed-origins=http:// | ||
Line 221: | Line 185: | ||
idm.sec.security.jwt.secret.token=********** TODO ********* | idm.sec.security.jwt.secret.token=********** TODO ********* | ||
idm.sec.security.jwt.expirationTimeout=36000000 | idm.sec.security.jwt.expirationTimeout=36000000 | ||
- | + | ||
# Cipher secret key for crypt values in confidential storage | # Cipher secret key for crypt values in confidential storage | ||
# for crypt values is used secretKey or secretKey defined by file - secretKeyPath | # for crypt values is used secretKey or secretKey defined by file - secretKeyPath | ||
# | # | ||
cipher.crypt.secret.keyPath=/ | cipher.crypt.secret.keyPath=/ | ||
- | + | ||
# Defaults for: emailer.* | # Defaults for: emailer.* | ||
# test.enabled=true means mail WILL NOT be sent | # test.enabled=true means mail WILL NOT be sent | ||
Line 244: | Line 208: | ||
# Admin user role | # Admin user role | ||
idm.sec.core.role.admin=superAdminRole | idm.sec.core.role.admin=superAdminRole | ||
- | + | ||
# Max file size of uploaded file. Values can use the suffixed " | # Max file size of uploaded file. Values can use the suffixed " | ||
spring.servlet.multipart.max-file-size=100MB | spring.servlet.multipart.max-file-size=100MB | ||
Line 274: | Line 238: | ||
There are two properties in application-production.properties that influence the confidential storage: | There are two properties in application-production.properties that influence the confidential storage: | ||
- | * You can set the 128bit (16byte) | + | * You can set the key directly in the property file using **cipher.crypt.secret.key** property |
- | * you can create separate file (in our case **secret.key**) containing a random string. Then you reference this file with **cipher.crypt.secret.keyPath** property. | + | * or (better) |
<note warning> | <note warning> | ||
- | Confidential storage uses AES/ | + | Confidential storage uses AES/ |
+ | < | ||
+ | Length of the key determines the cipher which will be used. If you use 128b (16byte) key, CzechIdM will use AES-128. If you use 256b (32byte) key, CzechIdM will use AES-256. | ||
+ | |||
+ | * OpenJDK/JDK 1.8u161 and all higher versions support AES-256 by default. | ||
+ | * Older versions (below 1.8u161) do not offer it. On those Java distributions, | ||
+ | |||
+ | </ | ||
=== Attachment store === | === Attachment store === | ||
Line 302: | Line 273: | ||
- | ==== 7. Set correct permissions on CzechIdM files ==== | + | ==== 6. Set correct permissions on CzechIdM files ==== |
- | **CentOS** | + | |
< | < | ||
chown tomcat: | chown tomcat: | ||
Line 311: | Line 281: | ||
</ | </ | ||
- | ==== 8. Adjust Tomcat' | + | ==== 7. Adjust Tomcat' |
- | Apache Tomcat has to know where the new configuration is. Because CzechIdM uses SpringBoot project, we simply add the **/ | + | Apache Tomcat has to know where the new configuration is. Because CzechIdM uses SpringBoot project, we simply add the '' |
- | Create new file **/ | + | Create new file '' |
<code bash:> | <code bash:> | ||
Line 325: | Line 295: | ||
</ | </ | ||
- | ==== 9. Create dedicated Java truststore ==== | + | ==== 8. Create dedicated Java truststore ==== |
Java truststore is a file which contains SSL certificates which we consider trusted. Usually this means some certificates of end systems or their respective certificate authorities. | Java truststore is a file which contains SSL certificates which we consider trusted. Usually this means some certificates of end systems or their respective certificate authorities. | ||
When we need CzechIdM to communicate with some new system with SSL-encrypted way, we need to import particular certificate here and restart the Tomcat container. | When we need CzechIdM to communicate with some new system with SSL-encrypted way, we need to import particular certificate here and restart the Tomcat container. | ||
Line 352: | Line 322: | ||
systemctl restart tomcat.service | systemctl restart tomcat.service | ||
</ | </ | ||
- | ==== 10. Deploy the CzechIdM ==== | + | ==== 9. Deploy the CzechIdM ==== |
- | Download the latest CzechIdM version. Currently it is idm-app-9.4.0.war. | + | Download the latest CzechIdM version. Currently it is idm-app-10.4.1.war. |
Ensure Tomcat is stopped: | Ensure Tomcat is stopped: | ||
Line 359: | Line 329: | ||
systemctl stop tomcat.service | systemctl stop tomcat.service | ||
</ | </ | ||
- | Copy the identity manager WAR into webapps folder in Tomcat and name it **idm.war**: | + | Copy the identity manager WAR into webapps folder in Tomcat and name it '' |
< | < | ||
- | cp idm-app-9.4.0.war / | + | cp idm-app-10.4.1.war / |
- | chown tomcat: | + | |
</ | </ | ||
Start the Tomcat container:< | Start the Tomcat container:< | ||
systemctl start tomcat.service | systemctl start tomcat.service | ||
</ | </ | ||
- | If everything is set up right, the CzechIdM will deploy. Default log is **/ | + | If everything is set up right, the CzechIdM will deploy. Default log is '' |
- | ==== 11. Final Steps ==== | + | ==== 10. Final Steps ==== |
=== Allow network services === | === Allow network services === | ||
Line 376: | Line 345: | ||
<code bash> | <code bash> | ||
+ | firewall-cmd --permanent --add-port=80/ | ||
firewall-cmd --permanent --add-port=443/ | firewall-cmd --permanent --add-port=443/ | ||
firewall-cmd --reload | firewall-cmd --reload |