Installing Oracle Linux 8.4 With Apex 21/ Tomcat 9 running in pluggable Oracle XE 21c database(pdb)
//Software download URL’s at the end of this document.
//Custom Template for server config and password attached to this document.
Network
Hostname ????????????
Server ip ????????????
Network mask ????????????
Gateway ????????????
DNS ????????????
Passwords
General password policies:
General Administrative password | [Admin Password] | ???? |
PUBLIC accounts password | [PUBLIC Password] | ???? |
Service Password | [SERVICE Password] | ???? |
Specific username and passwords:
Root password | [root Password] | ???????? |
Tomcat Admin password user: admin | [Tomcat Password] | ????? |
Apex Instance Manager Workspace: internal User: admin | [Apex Instance Password] | ????? |
SYS password | [SYSDBA password] | ????? |
Schema passwords:
APEX_LISTENER | [SERVICE password] |
APEX_REST_PUBLIC_USER | [PUBLIC Password] |
ORDS_PUBLIC_USER | [PUBLIC Password] |
APEX_PUBLIC_USER | [PUBLIC Password] |
Roadmap
- Create Virtual Machine
- Install Oracle Linux 8.4
CockPit (optional) - Install Apache Tomcat 9.0.53
- Install Oracle Database 21C XE
Oracle Enterprise Manager Express setup (optional) - Install Oracle Apex 21.1.0.0
- Install Oracle REST Data Services (ORDS)
- Oracle APEX patch 5.
Create Virtual Machine
VirtualBox Installation
Memory: 4Gb
DIsk; 50GB (min. 20GB)
Settings:
Network -> Adapter 1 = “Bridged Adapter”
Oracle Linux 8.4 installation
PRE
Load install media in cdrom drive and start serverVirtualBox:Settings -> Storage:Controller IDE, highlight CD(empty) and add installation media under Optical Device
INSTALL Software
Installation starts automatically if the install media was mounted correctly.
- Choose English (Denmark) as language for the installation and click Continue
- Next window show all settings that need to be completed before starting the installation.
Start in this order:- “Network and Host”
- Enable Ehternet, set hostname and configure IPv4 with a static IP
- “Time & Date”
- Set Europe, Copenhagen as timezone.
- “Software Selection”
- Choose Server & Development Tools
- “Installation Destination”
- Just confirm it by clicking Done.
- Root Password
- Set Root password to [root password]
- “Network and Host”
- Begin Installation
- This takes a while.
- Reboot Server
INSTALL updates and tools//Get latest updates.
as root
dnf update -y
//disable firewall completely
systemctl stop firewalld
systemctl disable firewalld
//Add your servers ip to the hosts file
vi /etc/hosts
Generic
192.168.1.191 apex apex.bluegecko.local
//add server to clients host file. (conditional)
Note: If your server name does not resolve on your client you can add it to you local host file, so it at least resolves from your specific client.
In windows you need to start notepad as administrator in order to edit the file.
You can do that by locating the notepad icon in the windows start menu, right click it
and choose “run as administrator” from the file menu you can then easily open and edit
C:\Windows\System32\drivers\etc\hosts
//entry to add
192.168.1.191 apex apex.bluegecko.local
//Setup Cockpit (Optional)
systemctl enable --now cockpit.socket
//Update system from Cockpit Interface.
Expecting no updates to be found, but done to make initial updates to internal catalogs.
Username: root/[root password]
https://apex.lyretech.local:9090/
Navigate to Software updates and wait until interface states
“System is up to date”
STAGE software(optional)
See the “Software” section for a list of software needed and their download instructions.Either mount /software to your external software archive or place the software in a local directory.Note:
Using VirtualBox’s “Shared folder” function to map local download folder with /software works perfectly, but requires installation of VirtualBox Guest Extensions on the server.
mkdir /software
chmod 775 /software
//Stage the software in /software using ftp, wget etc.
ls -Shog
total 2,6G
-rw-r--r--. 1 2,2G Sep 30 09:16 oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm
-rw-r--r--. 1 220M Oct 1 05:59 apex_21.1.zip
-rw-r--r--. 1 99M Oct 2 10:55 OpenJDK8U-jdk_x64_linux_hotspot_8u302b08.tar.gz
-rw-r--r--. 1 70M Oct 3 03:57 ords-21.2.4.243.1032.zip
-rw-r--r--. 1 12M Oct 2 07:44 apache-tomcat-9.0.53.tar.gz
-rw-r--r--. 1 3,0M Oct 3 08:03 p32598392_2110_Generic.zip
-rw-r--r--. 1 31K Oct 3 04:24 oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
NullPOSTThis is a good time for a backup of the virtual machine.
OS is installed, updates applied, network confirmed and software staged on the server.
TOMCAT 9.0.53 Installation
//Assuming software has been downloaded and placed in public readable directory /software
as root create tomcat owner.
useradd tomcat
mkdir -p /opt/tomcat
chown tomcat:tomcat /opt/tomcat
//Install Java specifically for Tomcat
su - tomcat
mkdir -p /opt/tomcat/java
cd /opt/tomcat/java
tar xvf /software/OpenJDK8U-jdk_x64_linux_hotspot_8u302b08.tar.gz
ln -s jdk8u302-b08 latest
//Install Tomcat
cd /opt/tomcat
tar xvf /software/apache-tomcat-9.0.53.tar.gz
ln -s apache-tomcat-9.0.53 latest
//Update Environment
// Add environment settings to login profile
vi /home/tomcat/.bash_profile
#Tomcat Environment
export JAVA_HOME=/opt/tomcat/java/latest
export CATALINA_HOME=/opt/tomcat/latest
//Log out and in again and start/stop Tomcat
set environment and create default tomcat configuration.
exit
su - tomcat
Generic
$CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh
//Enable remote access to html interfaces and define admin user
INSIDE the “tomcat-users” tag add the user definition:
Obs! Alter the password [Tomcat Password]
vi $CATALINA_HOME/conf/tomcat-users.xml
<user username="admin" password="[Tomcat Password]" roles="manager-gui, admin-gui"/>
//Create manager.xml with following tag
vi $CATALINA_HOME/conf/Catalina/localhost/manager.xml
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
Null//Create host-manager.xml with following tag
vi $CATALINA_HOME/conf/Catalina/localhost/host-manager.xml
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/host-manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
//Start Apache Tomcat
$CATALINA_HOME/bin/startup.sh
//Output;
Using CATALINA_BASE: /opt/tomcat/latest
Using CATALINA_HOME: /opt/tomcat/latest
Using CATALINA_TMPDIR: /opt/tomcat/latest/temp
Using JRE_HOME: /opt/tomcat/java/latest
Using CLASSPATH: /opt/tomcat/latest/bin/bootstrap.jar:/opt/tomcat/latest/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
//Check access to Tomcat Landing page
http://apex.bluegecko.local:8080/
Tomcat Web Application Manager
http://apex.bluegecko.local:8080/manager/html
username: admin password: [Admin Password]
Tomcat Server Status
http://apex.bluegecko.local:8080/manager/status
username: admin password: [Admin Password]
su - tomcat
$CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh
Oracle XE 21C Installation
INSTALL//Assuming database software is available in /software
Note: Oracle Database Preinstall Check is automatically downloaded and execute when running the database install on a Oracle Linux platform, but in the time of writting a bug requires you to run it manually to created home directory correctly.
//Verify, install and setup user/group requirements before installing database software by running “Oracle Database Preinstall Check”as root
dnf -y localinstall /software/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
Null
OUTPUT
Installed:
compat-openssl10-1:1.0.2o-3.el8.x86_64
gssproxy-0.8.0-19.el8.x86_64
keyutils-1.5.10-6.el8.x86_64
ksh-20120801-254.0.1.el8.x86_64
libX11-xcb-1.6.8-4.el8.x86_64
libXtst-1.2.3-7.el8.x86_64
libXv-1.0.11-7.el8.x86_64
libXxf86dga-1.1.5-1.el8.x86_64
libdmx-1.1.4-3.el8.x86_64
libnsl-2.28-151.0.1.el8.x86_64
libverto-libevent-0.3.0-5.el8.x86_64
lm_sensors-libs-3.4.0-22.20180522git70f7e08.el8.x86_64
nfs-utils-1:2.3.3-41.el8_4.2.x86_64
oracle-database-preinstall-21c-1.0-1.el8.x86_64
rpcbind-1.2.5-8.el8.x86_64
sysstat-11.7.3-5.0.1.el8.x86_64
xorg-x11-utils-7.5-28.el8.x86_64
xorg-x11-xauth-1:1.0.9-12.el8.x86_64
Complete!
Generic
//Install Oracle Software in /opt/oracle
dnf -y localinstall /software/oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm
Null
OUTPUT
Installed:
oracle-database-xe-21c-1.0-1.x86_64
Null//Create and configure database
Note: When prompted set SYS, SYSTEM and PDBADMIN password for [Admin Password]
/etc/init.d/oracle-xe-21c configure
NullNow go outside and play.. this take a while..
OUTPUT:
100% Completed.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Connect to Oracle Database using one of the connect strings:
Pluggable database: apex.lyretech.local/XEPDB1
Multitenant container database: apex.lyretech.local
Null
//Setup Oracle environment by adding entries to .bash_profile
su - oracle
vi /home/oracle/.bash_profile
Null
export ORACLE_SID=XE
export ORAENV_ASK=NO
. oraenv
Null//Set Oracle environment (CDB)
exit
su - oracle
lsnrctl status
Null
Services Summary...
Service "XE" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
Service "cdba8e5749a64368e053b901a8c02fef" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
Service "xepdb1" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully
Generic
//Enable Autostart of Oracle Listener and Database as root
systemctl daemon-reload
systemctl enable oracle-xe-21c
Generic
Now reboot system and verify that database(s) are up and running.
reboot
Generic
//Verify that the Oracle listener at least services XE and xepdb1
su - oracle
lsnrctl status | grep instance
GenericOUTPUT:
Service "XE" has 1 instance(s).
Service "XEXDB" has 1 instance(s).
Service "cdba8e5749a64368e053b901a8c02fef" has 1 instance(s).
Service "xepdb1" has 1 instance(s).
HTML//Verify that both container database( and the pluggable database(xepdb1) is running
sqlplus / as sysdba
show con_name
select * from dual;
alter session set container = xepdb1;
show con_name
select * from dual;
exit;
Generic
Oracle EM Express setup (optional)
Note: Oracle EM Express will be depreciated in next version of the database.// connect to CDB container
su - oracle
sqlplus / as sysdba
show con_name
exec dbms_xdb_config.sethttpsport(0);
exec dbms_xdb_config.setglobalportenabled(TRUE);
alter session set container=XEPDB1;
show con_name
exec dbms_xdb_config.sethttpsport(5500);
GenericVerify that you can login to Oracle Enterprise Manager Express
//username: system password: [ADMIN password]
BACKUP
This is a good time for a backup of the virtual machine.
OS is installed, updates applied, network confirmed and software staged on the server. Tomcat is installed and setup. Oracle database and its environment has been setup. Databae is starting automatically.
Oracle APEX Installation
PRE
//Connect to PDB and create dedicated tablespaces for APEX data
su - oracle
sqlplus / as sysdba
alter session set container = xepdb1;
show con_name
Null
CREATE TABLESPACE APEX_DATA
DATAFILE
'/opt/oracle/oradata/XE/XEPDB1/apex_data01.dbf' SIZE 200M AUTOEXTEND ON NEXT 10M MAXSIZE 2G
LOGGING
DEFAULT
NO INMEMORY
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
Null
CREATE TABLESPACE APEX_FILES
DATAFILE
'/opt/oracle/oradata/XE/XEPDB1/apex_file01.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE 250M
LOGGING
DEFAULT
NO INMEMORY
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
Generic
ALTER DATABASE DATAFILE '/opt/oracle/oradata/XE/XEPDB1/users01.dbf'
AUTOEXTEND ON
NEXT 1280K
MAXSIZE 250M;
Null
ALTER DATABASE DATAFILE '/opt/oracle/oradata/XE/XEPDB1/sysaux01.dbf'
AUTOEXTEND ON
NEXT 10M
MAXSIZE 1G;
Null
ALTER DATABASE DATAFILE '/opt/oracle/oradata/XE/XEPDB1/system01.dbf'
AUTOEXTEND ON
NEXT 10M
MAXSIZE 2G;
Null
//exit sql*plus
exit
Generic
INSTALL
//Upzip Apex files
su - oracle
cd /opt/oracle
unzip /software/apex_21.1.zip
cd apex
Null
//Install APEX into pluggable database XEPDB1
sqlplus / as sysdba
alter session set container=xepdb1;
Null
@apexins.sql apex_data apex_files temp /i/
Null
OUTPUT:
timing for: Phase 3 (Switch) Elapsed: 00:00:59.95 timing for: Complete Installation Elapsed: 00:06:09.81 PL/SQL procedure successfully completed. 1 row selected. ...null1.sql
//Create APEX instance administratorNote: When prompted:Enter the administrator’s username [ADMIN]
Enter ADMIN’s email [ADMIN] admin@lyretech.dk
Enter ADMIN’s password [Apex Instance Password]
@apxchpwd.sql
Generic
"Created instance administrator ADMIN."
Null
//unlock the APEX_PUBLIC_USER
account and set new password [PUBLIC Password]
sqlplus / as sysdba
alter session set container = xepdb1;
show con_name
alter user APEX_PUBLIC_USER account unlock;
alter user APEX_PUBLIC_USER identified by [PUBLIC Password];
HTML
// Make the account APEX_PUBLIC_USER used for Oracle REST Data Services never expires (default = 180 days)
CREATE PROFILE "APEX_PUBLIC_USER" LIMIT
SESSIONS_PER_USER UNLIMITED
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
CONNECT_TIME UNLIMITED
IDLE_TIME UNLIMITED
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
COMPOSITE_LIMIT UNLIMITED
PRIVATE_SGA UNLIMITED
FAILED_LOGIN_ATTEMPTS 10
INACTIVE_ACCOUNT_TIME 365
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 7
PASSWORD_VERIFY_FUNCTION NULL;
ALTER USER APEX_PUBLIC_USER PROFILE APEX_PUBLIC_USER;
Generic
//exit sql*plus
exit
Generic
Oracle REST Data Services(ords) installation with Tomcat
PRE
//Create dedicated tablespaces for ORDS
su - oracle
cd /opt/oracle/apex
sqlplus / as sysdba
Null
alter session set container=xepdb1;
Null
CREATE TABLESPACE ORDS_PUBLIC_USER
DATAFILE
'/opt/oracle/oradata/XE/XEPDB1/ords_public_user01.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE 1G
LOGGING
DEFAULT
NO INMEMORY
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
CREATE TABLESPACE ORDS_METADATA
DATAFILE
'/opt/oracle/oradata/XE/XEPDB1/ords_meta01.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE 1G
LOGGING
DEFAULT
NO INMEMORY
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
//Setup RESTfull Services
When prompted use [SERVICE Password] for APEX_LISTENER and APEX_REST_PUBLIC_USER
show con_name
!pwd #/opt/oracle/apex
@apex_rest_config.sql
Generic
exit
Generic//create install directory and unzip ORDS software
su - oracle
mkdir -p /opt/oracle/ords
cd /opt/oracle/ords
unzip /software/ords-21.2.4.243.1032.zip
// Move Images to Tomcat.
as root
su -
cp -r /opt/oracle/apex/images /opt/tomcat/latest/webapps/i
chown -R tomcat:tomcat /opt/tomcat/latest/webapps/i
exit
Generic// Create directory for configuration and install ORDS
su - oracle
mkdir -p /opt/oracle/ords/config
cd /opt/oracle/ords
java -jar ords.war install advanced
- Enter the location to store configuration data: /opt/oracle/ords/config
- Specify the database connection type to use: [ENTER] (BASIC)
- Enter the name of the database server :[ENTER] (localhost)
- Enter the database listen port: [ENTER] (1521)
- Enter 1 to specify the database service name, or 2 to specify the database SID: [ENTER] (1)
- Enter the database service name: XEPDB1
- Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step: [ENTER] (1)
- Enter the database password for ORDS_PUBLIC_USER: [PUBLIC Password]
- Enter the administrator username: sys
- Enter the database password for SYS AS SYSDBA: [Admin Password]
- Enter the default tablespace for ORDS_METADATA [SYSAUX]:ORDS_METADATA
- Enter the temporary tablespace for ORDS_METADATA [TEMP]: [ENTER] (temp)
- Enter the default tablespace for ORDS_PUBLIC_USER [SYSAUX]:ORDS_PUBLIC_USER
- Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP]:[ENTER] (temp)
- If using Oracle Application Express or migrating from mod_plsql then you must enter 1: [ENTER] (1)
- Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]: [ENTER] (APEX_PUBLIC_USER)
- Enter the database password for APEX_PUBLIC_USER: [PUBLIC Password]
- Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]: [ENTER] (1)
- Enter the database password for APEX_LISTENER: [Service Password]
- Enter the database password for APEX_REST_PUBLIC_USER: [PUBLIC Password]
- Enter a number to select a feature to enable:[ENTER] (SQL Developer Web (Enables all features))
Completed installation for Oracle REST Data Services version 21.2.4.r2431032. Elapsed time: 00:00:16.109
- Enter 1 if you wish to start in standalone mode or 2 to exit [1]: 2 (EXIT)
//Deploy ORDS to Tomcatas root
su -
cp /opt/oracle/ords/ords.war /opt/tomcat/latest/webapps
chown tomcat:tomcat /opt/tomcat/latest/webapps/ords.war
Generic
//Start Tomcat
su - tomcat
cd /opt/tomcat/latest/bin
./startup.sh
Generic
//Verify apex
Workspace: internal, username: admin & password [APEX Instance Password]
http://apex.bluegecko.local:8080/ords
When logged in check APEX versin in lower right corner of page
Application Express 21.1.0
APEX Patch Installation
PRE
//Shutdown Tomcat to restrict access to ORDS while patching.
su - tomcat
$CATALINA_HOME/bin/shutdown.sh
exit
Generic
INSTALL//When prompted for passworh then enter [Admin Password]
su - oracle
mkdir -p /opt/oracle/apex/patches
cd /opt/oracle/apex/patches
unzip /software/p32598392_2110_Generic.zip
cd 32598392
sqlplus sys@//localhost:1521/xepdb1 as sysdba @catpatch.sql
GenericAs Root
su -
\cp -rf /opt/oracle/apex/patches/32598392/images/*.* /opt/tomcat/latest/webapps/i
Null
POST
// Start Tomcat to make ORDS available again.
su - tomcat
$CATALINA_HOME/bin/startup.sh
Generic
//Verify apex version
Workspace: internal, username: admin & password [APEX Instance Password]
http://apex.bluegecko.local:8080/ords
When logged in check APEX versin in lower right corner of page
Application Express 21.1.5
Now go outside and play.
URLs
Tomcat manager apps
https://apex.bluegecko.local:9090/
admin/[Admin Password]
Oracle Enterprise Manager Express
https://apex.bluegecko.local:5500/em
username: system password: [Admin Password]
Cockpit
https://apex.bluegecko.local:9090/
root/[root Password]
Oracle APEX Instance Manager
http://apex.bluegecko.local:8080/ords
Workspace: internal, username: admin, password [APEX Instance Password]
References
DATABASE
INSTALL GUIDE:
https://docs.oracle.com/en/operating-systems/oracle-linux/8/install/ol8-install-prepare.html
https://docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/oracle-database-installation-checklist.html#GUID-E847221C-1406-4B6D-8666-479DB6BDB046
GET STARTED:
https://docs.oracle.com/en/database/oracle/oracle-database/21/index.html
APEX
COCKPIT
https://docs.oracle.com/en/operating-systems/oracle-linux/8/obe-cockpit-system/#before-you-begin
TOMCAT
https://oracle-base.com/articles/linux/apache-tomcat-9-installation-on-linux
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-installation-on-tomcat
https://www.ateam-oracle.com/post/installing-tomcat-on-oracle-linux-in-oracle-cloud
SOFTWARE
Oracle Linux 8.4 OS: Full ISO
OracleLinux-R8-U4-x86_64-dvd.isohttps://yum.oracle.com/oracle-linux-isos.html
Apache TOMCAT: CORE, tar.gz 9.0.53
https://tomcat.apache.org/download-90.cgi
Open JDK 8: 8u302b08
https://adoptium.net/releases.html?variant=openjdk8&jvmVariant=hotspot
Preinstall RPMs for RHEL 8 //Includes bugfix needed for correct setting up OS environment
https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
RDBMS: 21c XE OL8
https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm( https://www.oracle.com/database/technologies/xe-downloads.html )
APEX: 21.1 all languages
https://www.oracle.com/tools/downloads/apex-downloads.html
APEX: Patch Set Bundle for Oracle APEX 21.1 (32598392)
https://support.oracle.com/epmos/faces/PatchDetail?patchId=32598392
ORDS: Version 21.2.4.243.1032 – September 1, 2021
https://www.oracle.com/database/technologies/appdev/rest-data-services-downloads.html