Describe the various ways to install Red Hat Single Sign-On.
Outcomes
Install RH-SSO from a .zip file.
Change the default H2 database to a PostgreSQL database.
Configure RH-SSO as a service that starts on boot.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start install-ways
Procedure 2.1. Instructions
From workstation, log in to the sso machine as the rhsso user.
[student@workstation ~]$ ssh rhsso@sso
...output omitted...
[rhsso@sso ~]$Unpack the rh-sso-7.6.0-server-dist.zip file to the /opt directory.
You can find the .zip file in the rhsso user home directory.
Set the appropriate permissions to the directory.
Unpack the rh-sso-7.6.0-server-dist.zip file to the /opt directory by using the unzip utility.
[rhsso@sso ~]$ sudo unzip rh-sso-7.6.0-server-dist.zip -d /opt
...output omitted...Modify the user and group owner for the /opt/rh-sso-7.6 directory to rhsso.
[rhsso@sso ~]$ sudo chown -R rhsso:rhsso /opt/rh-sso-7.6Create the EAP module for the PostgreSQL JDBC driver.
Create the directory structure for the module definition.
[rhsso@sso ~]$ mkdir -p \
/opt/rh-sso-7.6/modules/system/layers/keycloak/org/postgresql/mainCopy the PostgreSQL JDBC driver jar file to the modules directory.
You can find the jar file in the rhsso user home directory.
[rhsso@sso ~]$ cp postgresql-42.5.0.jar \
/opt/rh-sso-7.6/modules/system/layers/keycloak/org/postgresql/main/Create and execute the sso-extensions.cli script to point to the PostgreSQL database.
The URL of the PostgreSQL database is sso.lab.example.com and it uses the standard TCP port 5432.
The name for the database is keycloack, the user is postgres, and the password is postgres.
Copy the RH-SSO extensions JBoss script to the /opt/rh-sso-7.6/bin directory.
You can find the script in the rhsso user home directory.
[rhsso@sso ~]$ cp sso-extensions.cli /opt/rh-sso-7.6/bin/Modify the /opt/rh-sso-7.6/bin/sso-extensions.cli file to point to the PostgreSQL database.
You must provide the values for the DB_USERNAME, DB_PASSWORD, CONNECTION_URL, and FILE variables.
The content of the file should be as follows.
Note that the FILE line has been split so that it displays correctly in the PDF guide.
Do not add the line break in your RH-SSO extensions JBoss script file.
batch set DB_USERNAME=postgresset DB_PASSWORD=postgresset DRIVER_NAME=postgres set DRIVER_MODULE_NAME=org.postgres set XA_DATABASESOURCE_CLASS="org.postgresql.xa.PGXADataSource" set CONNECTION_URL="jdbc:postgresql://sso.lab.example.com:5432/keycloak" set FILE=/opt/rh-sso-7.6/modules/system/layers/keycloak/org/postgresql/main/postgresql-42.5.0.jar...output omitted...
Launch the sso-extensions.cli script by using the JBoss management CLI.
[rhsso@sso ~]$ /opt/rh-sso-7.6/bin/jboss-cli.sh \
--file=/opt/rh-sso-7.6/bin/sso-extensions.cli
...output omitted...Create the admin user for RH-SSO with redhat as the password.
You can find the script to add administrator users in the /opt/rh-sso-7.6/bin directory.
[rhsso@sso ~]$ /opt/rh-sso-7.6/bin/add-user-keycloak.sh -u admin -p redhat
Added 'admin' to '/opt/rh-sso-7.6/standalone/configuration/keycloak-add-user.json', restart server to load userConfigure RH-SSO as a service that starts on boot.
Modify the JBoss configuration file in /opt/rh-sso-7.6/bin/init.d/jboss-eap.conf with the location of JBoss EAP, the username, the mode, and the log directory.
The content of the file should be as follows:
# General configuration for the init.d scripts, # not necessarily for JBoss EAP itself. # default location: /etc/default/jboss-eap ## Location of JDK # JAVA_HOME="/usr/lib/jvm/default-java" ## Location of JBoss EAPJBOSS_HOME="/opt/rh-sso-7.6"## The username who should own the process.JBOSS_USER=rhsso## The mode JBoss EAP should start, standalone or domainJBOSS_MODE=standalone## Configuration for standalone mode # JBOSS_CONFIG=standalone.xml ## Configuration for domain mode # JBOSS_DOMAIN_CONFIG=domain.xml # JBOSS_HOST_CONFIG=host-master.xml ## The amount of time to wait for startup # STARTUP_WAIT=60 ## The amount of time to wait for shutdown # SHUTDOWN_WAIT=60 ## Location to keep the console logJBOSS_CONSOLE_LOG="/opt/rh-sso-7.6/standalone/log/console.log"## Additionals args to include in startupJBOSS_OPTS="-b 0.0.0.0"
Copy the modified service file to the /etc/default directory.
[rhsso@sso ~]$ sudo cp /opt/rh-sso-7.6/bin/init.d/jboss-eap.conf /etc/defaultCopy the service start up script to the /etc/init.d directory.
Give it execute permissions and reset its SELinux security context.
[rhsso@sso ~]$sudo cp /opt/rh-sso-7.6/bin/init.d/jboss-eap-rhel.sh /etc/init.d[rhsso@sso ~]$sudo chmod +x /etc/init.d/jboss-eap-rhel.sh[rhsso@sso ~]$sudo restorecon /etc/init.d/jboss-eap-rhel.sh
Add the new service to the list of automatically started services.
Reload systemd manager configuration.
[rhsso@sso ~]$sudo chkconfig --add jboss-eap-rhel.sh[rhsso@sso ~]$sudo systemctl daemon-reload
Start the service and enable it on boot.
[rhsso@sso ~]$sudo service jboss-eap-rhel startRedirecting to /bin/systemctl start jboss-eap-rhel.service [rhsso@sso ~]$sudo chkconfig jboss-eap-rhel.sh on
Check the status for the service. Check the logs for verifying the JDBC connection.
Verify the status for the service.
[rhsso@sso ~]$systemctl status jboss-eap-rhel●jboss-eap-rhel.service- SYSV: JBoss EAP startup script Loaded: loaded (/etc/rc.d/init.d/jboss-eap-rhel.sh; generated) Active:active (running)since Wed 2022-11-16 07:23:57 EST; 29s ago Docs: man:systemd-sysv-generator(8) Main PID: 34369 (java) ...output omitted...
Review the logs and verify the JDBC connection.
[rhsso@sso ~]$cat /opt/rh-sso-7.6/standalone/log/server.log...output omitted... 05:53:21,889 INFO [org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory] (ServerService Thread Pool -- 64) Database info: {databaseUrl=jdbc:postgresql://sso.lab.example.com:5432/keycloak,databaseUser=postgres, databaseProduct=PostgreSQL 10.19, databaseDriver=PostgreSQL JDBC Driver 42.5.0} ...output omitted...
On the workstation machine, use Firefox to navigate to the RH-SSO web UI URL at https://sso.lab.example.com:8080.
Click .
Log in as the admin user with redhat as the password.

Return to the workstation system as the student user.
[rhsso@sso ~]$ exit
[student@workstation ~]$