Wednesday, January 4, 2017

APEX 5.0 Installation using ORDS on WebLogic Server

it's a two tier architecture where the DB that hosts the APEX schema is on one server and the Application Listener is on a different server.

We will be carrying out whole installation setup from the Application server itself, we don't have to do anything on the DB server other than making sure the password file is present and configured so that we can connect as with sysdba privilege from Application server.


APEX Installation:

1) Download the s/w from the Oracle site.
http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html



2) Unzip Downloaded file.
$unzip apex_5.0.zip 




3) Connect to the DB as SYS specifying the sysdba privilege.
$cd apex

SQL> sho user
USER is "SYS"
SQL>@apexins.sql APEX APEX TEMP3 /i/
.
.
.
.
.
Thank you for installing Oracle Application Express 5.0.4.00.12

Oracle Application Express is installed in the APEX_050000 schema.

The structure of the link to the Application Express administration services is as follows:
http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql)
http://host:port/apex/apex_admin     (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)
http://host:port/apex/apex_admin     (Oracle REST Data Services)

The structure of the link to the Application Express development interface is as follows:
http://host:port/pls/apex (Oracle HTTP Server with mod_plsql)
http://host:port/apex     (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)
http://host:port/apex     (Oracle REST Data Services)

PL/SQL procedure successfully completed.

1 row selected.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options




4) Creating Instance Administration Account
SQL> @apxchpwd.sql
Usage: SET SERVEROUTPUT { ON | OFF } [SIZE n]
             [ FOR[MAT] { WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED] } ]
================================================================================
This script can be used to change the password of an Application Express
instance administrator. If the user does not yet exist, a user record will be
created.
================================================================================
Enter the administrator's username [ADMIN]
Enter ADMIN's email [ADMIN]
Enter ADMIN's password []

SQL>



5) Configuring the APEX_PUBLIC_USER Account

SQL>ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;


6) Configuring RESTful 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 user
...create APEX_REST_PUBLIC_USER user
SQL>



7) DB Users created as part of APEX installation.

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
APEX_050000                    OPEN
APEX_PUBLIC_USER               OPEN
FLOWS_FILES                    OPEN
APEX_LISTENER                  OPEN
APEX_REST_PUBLIC_USER          OPEN





Oracle REST Data Services Installation:

1) Downloading Oracle REST Data Services.
http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html


2) Unzip the downloaded zip file into a directory(ORDS).
$mkdir config

$unzip ords.3.0.9.348.07.16.zip

$ls -1;
ls
config
docs
examples
logs
ords.3.0.9.348.07.16.zip
ords.war
params
readme.html


3) Set parameters before the installation.

~/ORDS/params/ords_params.properties

db.hostname=glerpdvdb05.devglobalpay.com
db.port=1521
db.servicename=DEV
db.sid=DEV
db.username=APEX_PUBLIC_USER
migrate.apex.rest=false
rest.services.apex.add=true
rest.services.ords.add=true
schema.tablespace.default=APEX
schema.tablespace.temp=TEMP3
standalone.http.port=8180
standalone.static.images=
user.tablespace.default=APEX
user.tablespace.temp=TEMP3

 



4) Set config dir
$java -jar ords.war configdir ~/ORDS/config


5) Install ORDS.
$java -jar ords.war install advanced
Enter the name of the database server [dev.oracle.com]:
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:2
Enter the database SID [xe]:DEV
Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:1
Enter the database password for ORDS_PUBLIC_USER:
Confirm password:
Please login with SYSDBA privileges to verify Oracle REST Data Services schema.

Enter the username with SYSDBA privileges to verify the installation [SYS]:
Enter the database password for SYS:
Confirm password:
Passwords do not match, try again
Enter the database password for SYS:
Confirm password:
Enter the default tablespace for ORDS_METADATA [APEX]:
Enter the temporary tablespace for ORDS_METADATA [TEMP3]:
Enter the default tablespace for ORDS_PUBLIC_USER [APEX]:
Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP3]:
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:
Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]:
Enter the database password for APEX_PUBLIC_USER:
Confirm 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 the database password for APEX_LISTENER:
Confirm password:
Enter the database password for APEX_REST_PUBLIC_USER:
Confirm password:
Jan 03, 2017 7:06:16 AM
INFO: Updated configurations: defaults, apex, apex_pu, apex_al, apex_rt
Installing Oracle REST Data Services version 3.0.9.348.07.16
... Log file written to ~/ORDS/logs/ords_install_core_2017-01-03_070616_00897.log
... Verified database prerequisites
... Created Oracle REST Data Services schema
... Created Oracle REST Data Services proxy user
... Granted privileges to Oracle REST Data Services
... Created Oracle REST Data Services database objects
... Log file written to ~/ORDS/logs/ords_install_datamodel_2017-01-03_070709_00868.log
Completed installation for Oracle REST Data Services version 3.0.9.348.07.16. Elapsed time: 00:00:55.858

Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2



6) Configuring Oracle Application Express Images.
$java -jar ords.war static ~/APEX_5.0/apex/images
WAR Generation complete
 WAR location     : ~/ORDS/i.war
 Context path     : /i
 Static resources : ~/APEX_5.0/apex/images
Ensure the static resources are available at path: ~/APEX_5.0/apex/images
on the server where the WAR is deployed.


$ls -1
config
docs
examples
i.war
logs
ords.3.0.9.348.07.16.zip
ords.war
params
readme.html







Additional Steps:
1) Disabling Oracle XML DB Protocol Server.
SQL> sho user
USER is "SYS"
SQL> EXEC DBMS_XDB.SETHTTPPORT(0);




Deploying to Oracle WebLogic Server:

We are assuming that WebLogic Server is installed and are deploying the *.war files on to a managed server.

Launch the WebLogic Administration Console by typing the following URL in your web browser:
http://<host>:<port>/console

 
1) Deploying on to the Managed Server.

To install the deployment:
    Go to the WebLogic Server Home Page. Below Domain Configuration, select Deployments.
    The Summary of Deployments is displayed.
    Click Install.
    Specify the location of the ords.war file and click Next.
    Select Install this deployment as an application and click Next.
    Select the servers and/or clusters to which you want to deploy the application or module and click Next.
    In the Optional Settings, specify the following:
        Name - Enter:
        ords
        Security - Select the following:
        Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor
        Source accessibility - Select:
        Use the defaults defined by the deployment's targets
    Click Next.
    A summary page is displayed.
    Click Finish.

    Repeat the previous steps to deploy the i.war file.
    In the optional settings, specify the following:
        Name - Enter:
        i
        Security - Select:
        Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor
        Source Accessibility - Select:
        Use the defaults defined by the deployment's targets.



2) Configuring WebLogic to Handle HTTP Basic Challenges Correctly.
Add the <enforce-valid-basic-auth-credentials> element to $DOMAIN_HOME/config/config.xml within the<security-configuration> element.

...
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>
</security-configuration>
...



3) Login into the APEX

http://<host>:<managed server port>/ords


workspace : internal
user : admin
password : 



 
 

1 comment:

  1. Great step by step guidance, was looking for such complete stuff for couple of weeks

    ReplyDelete