Thursday, May 14, 2020

APEX 19.2 installation and configure ORDS on tomcat

Dear Folks,

Here i am giving you overview of 19.2 APEX installation and configure REST DATA SERVICES and installation of TOMCAT.


What is APEX? What is it's use?

********Oracle APEX (Oracle Application Express) is enterprise low-code development platform in which developers use to develop and deploy their application that solve real problems and provide immediate value. It is no-cost feature of Oracle database.

What is ORDS?

*******Oracle REST Data Services (ORDS)  is a data service which is used to replace  Oracle HTTP server and mod_plsql. It bases on Java EE that provides RESTful service and increases security capability. it can deploy on WebLogic, Tomcat, Glassfish  or independently. Here we install on Tomcat.




Now we will see step by step installation of  APEX 19.2  on linux platform where oracle database 12.1.0.2 running along with ORDS installation.

Apex Link to download - https://www.oracle.com/tools/downloads/apex-192-downloads.html  ( apex_19.2_en.zip)

ORDS Link to Download - REST Data services 19.2 download - https://www.oracle.com/database/technologies/appdev/rest-data-services-v192-downloads.html  (ords-19.2.0.199.1647.zip) 

There are multiple ways we can install and configure ORDS.

Scenario : 1 - Apex with  Oracle XML DB HTTP listener with Embedded PL/SQL Gateway
Scenario : 2 :: Apex with Oracle HTTP server or  mod_plsql.
Scenario 3 :: Install APEX and configure ORDS. It replace completely  Oracle HTTP Server which shown in scenario 2 , therefore you can use  RESTful on APEX and new URL to work with  Oracle APEX.
                             Apex installation along with ORDS on tomcat ( Scenario:3) on database 12C

Download APEX software on database server  and unzip /u01/app/****/apex
apex_19.2_en.zip
Create separate tablespace for APEX to store APEX schemas. Our case created APEX tablespace.

cd /u01/app/***/apex

SQL> @apexins.sql APEX APEX TEMP /i/
Thank you for installing Oracle Application Express 19.2.0.00.18
Oracle Application Express is installed in the APEX_190200 schema.

                                         Change Application Express instance administrator password.
         SQL> @apxchpwd.sql
Check for  users APEX_PUBLIC_USER, APEX_INSTANCE_ADMIN_USER, APEX_190200. They should be open.

                                                                 Configure REST services

SQL> @apex_rest_config.sql
Enter a password for the APEX_LISTENER user              []
Enter a password for the APEX_REST_PUBLIC_USER user              []
...create APEX_LISTENER and APEX_REST_PUBLIC_USER users
PL/SQL procedure successfully completed.
APEX_LISTENER - The account used to query RESTful Services definitions stored in Oracle Application Express.
APEX_REST_PUBLIC_USER - The account used when calling RESTful Services definitions stored in Oracle Application Express.

                                     Change the image prefix for the whole APEX instance

cd /u01/app/*****/apex/utilities

SQL> @reset_image_prefix.sql
Enter the Application Express image prefix [/i/] /i/
...Changing Application Express image prefix
NEW
---
/i/
                                   Installation of ORDS and deploy on TOMCAT on Mid-Tier

Oracle REST Data Services supports the following Java EE application servers

                         Oracle Weblogic server :: 12g release 2 ( 12.2.1.3) and above
                         Tomcat - 8.5 and later


unzip ORDS software ords-19.2.0.199.1647.zip)  to /u01/app/****/ords

set ords_params.properties as below 

db.hostname=kchladrerbs01.ard.tks.com

db.password=*******
db.port=1522
db.sid=SIDNAME
db.username=APEX_PUBLIC_USER
migrate.apex.rest=false
plsql.gateway.add=true
rest.services.apex.add=true
rest.services.ords.add=true
restEnabledSql.active=true
schema.tablespace.default=APEX
schema.tablespace.temp=TEMP
standalone.mode=false
user.apex.listener.password=******
user.apex.restpublic.password=*********
user.public.password=*********
user.tablespace.default=APEX
user.tablespace.temp=TEMP


ORDS installation recommends Java JDK 8 or later. Download jdk1.8.0_241 install at 

/u02/app/****/ords/jdk/jdk1.8.0_241

export JAVA_HOME=/u02/app/****/ords/jdk/jdk1.8.0_241
export PATH=$PATH:$JAVA_HOME/bin
which java

/u02/app/****/ords/jdk/jdk1.8.0_241/bin/java

cd /u02/app/****/ords

/u02/app/*****/ords/jdk/jdk1.8.0_241/bin/java -jar ords.war    - It will install ORDS.
-
- Completed installation for Oracle REST Data Services version 19.2.0.r1991647.
                                                                                 

                                                              Tomcat installation

Download following software

OpenJDK11Downloads ( openjdk-11.0.1_linux-x64_bin.tar.gz)
Apache Tomcat ( used apache-tomcat-9.0.14)

Unzip JDK at  /u01/app/****/ords/java

 drwxrwxr-x 8      4096 Feb 17 23:22 jdk-11.0.1

create soft link  so we can Always use the same path for the JAVA_HOME environment variable >>> ln -s jdk-11.0.1 latest
lrwxrwxrwx 1      10 Feb 17 23:22 latest -> jdk-11.0.1

Unzip Tomcat at /u01/app/****/ords/tomcat and create soft link  so we can Always use the same path for the JAVA_HOME environment variable

drwxrwxr-x 9      4096 Feb 17 23:14 apache-tomcat-9.0.14
ln -s apache-tomcat-9.0.14 latest
lrwxrwxrwx 1     20 Feb 17 23:14 latest -> apache-tomcat-9.0.14

we want to separate config from binaries to make future upgrades easier, so we will create a new directory to act as the CATALINA_BASE location.

/u01/app/****/ords/tomcat
mkdir -p config/instance1
cp -r latest/conf  config/instance1/
cp -r latest/logs config/instance1/
cp -r latest/temp config/instance1/
cp -r latest/webapps config/instance1/
cp -r latest/work config/instance1/

apex.env should like below

export JAVA_HOME=/u01/app/**/ords/jdk/jdk1.8.0_241
export PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME=/u01/app/***/ords/java/latest
export CATALINA_HOME=/u01/app/***/ords/tomcat/latest
export CATALINA_BASE=/u01/app/***/ords/tomcat/config/instance1

copy APEX images from /u02/app/***/apex/images/* to webapps directory $ CATALINA_HOME /webapps/i
cd $ CATALINA_BASE/webapps
cp -Rp $CATALINA_HOME/webapps/i .
cp ords.war $CATALINA_HOME/webapps/
cp ords.war $CATALINA_BASE/webapps/

Start and stop of ORDS under TOMCAT

$CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh

Validate ORDS
/u01/app/***/ords/jdk/jdk1.8.0_241/bin/java -jar ords.war validate

Create ACLS
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => '*',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => 'APEX_190200',
principal_type => xs_acl.ptype_db));
END;
/

BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => 'kchladrerbs02.brg.tks.com',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => 'APEX_190200',
principal_type => xs_acl.ptype_db));
END;
/

Now you should be able to get TOMCAT and APEX URLS

Tomcat URL: http://kchladrerbs02.brg.tks.com:8090/
Apex URL: http:// kchladrerbs02.brg.tks.com:8090/ords/

No comments:

Post a Comment