Configuring Oracle APEX on Linux

What is Oracle APEX?

Oracle APEX (Application Express) is an enterprise low-code platform that enables you to build scalable, secure web and mobile applications quickly. It runs natively within the Oracle Database, allowing developers to build feature-rich apps using SQL and PL/SQL with minimal traditional programming.

Getting Started with Oracle APEX

Prerequisites

You must have an Oracle database, preferably a pluggable database, installed on the server where the APEX installation is going to be performed. Certain APEX versions require different version databases. In this case, I used APEX 24.2 with an Oracle Database release 19c (base release). But for higher APEX versions, such as APEX 26.1, you require Oracle Database release 19c with Database Release Update 19.18 (January 2023) or newer.

You can follow this guide on Installing Oracle Database 19c to configure a database in your environment.

APEX installation is usually done via the same user you used to configure the DB.

Step 01 - Download the APEX Software.

https://www.oracle.com/tools/downloads/apex-downloads/

(I downloaded the apex-latest.zip to my /u01/soft directory)

Step 02 - Create a home directory to deploy the zip file.

mkdir /u01/app/apex

cd /u01/app/apex

unzip /u01/soft/apex-latest.zip

Step 03 - Run the APEX installation script.

cd apex/

Log as sys via SQLPLUS to your pluggable database:

sqlplus sys/<sys_user_pwd>@ORCLPDB as sysdba

SQL> @apexins.sql SYSAUX SYSAUX TEMP /i/

(You must be in the apex home directory where this installation script resides in order for the above command to work)

Step 04 - Set APEX Admin Password.

SQL> @apxchpwd.sql

Set the password when prompted.

Step 05 - Configure the APEX_PUBLIC_USER account.

SQL> ALTER USER APEX_PUBLIC_USER IDENTIFIED BY <password> ACCOUNT UNLOCK;

Step 06 - Configuring REST Services.

SQL> @apex_rest_config.sql


Configuring ORDS (Oracle REST Data Services)

ORDS is required in order to access the APEX Workspace via a web browser.

Step 07 - Download ORDS.

https://www.oracle.com/database/sqldeveloper/technologies/db-actions/download/

Step 08 - Create a directory to unzip the ORDS files into.

mkdir /u01/app/ords

cd /u01/app/ords

unzip /u01/soft/ords-latest.zip

Step 09 - If Java is not present, you must install it on your server.

Install JAVA version 17 or higher in your environment.

Step 10 - Create the ORDS config directory.

mkdir /u01/app/ords/config

cd /u01/app/ords/bin

./ords --config /u01/app/ords/config install

Complete the installation. Now you will be able to access your Oracle APEX instance via the web using the following URL:

http://<server_ip>:8080/ords

You may notice that even though the landing page loads without issues, you are unable to view the APEX workspace tab. To fix this, we need to set the image path in ORDS.

Step 11 - Set the image's path.

./ords --config /u01/app/ords/config config set standalone. static.path /u01/app/apex/images

(Change the paths accordingly)

Step 12 - Start ORDS.

Now you can start ORDS and access the Workspace tab without any issues.

./ords --config /u01/app/ords/config serve

Running the command above starts the ORDS services in the CLI. Note that if the CLI connection is lost, ORDS will also be shut down. In order to run ORDS in the background, you can use the following command.

nohup ./ords --config /u01/app/ords/config serve &


Configuring SQL Developer Web User

You may notice that you cannot access the SQL Developer Web interface with a normal database user. In order to access the SQL Developer Web interface, you have to configure an existing user or a new user via the following command from within the database.

sqlplus sys/<sys_user_pwd>@ORCLPDB as sysdba

SQL > BEGIN

        ORDS.ENABLE_SCHEMA(

          p_enabled             => TRUE,

          p_schema              => 'APEX_USER',

          p_url_mapping_type    => 'BASE_PATH',

          p_url_mapping_pattern => 'apex_user',

          p_auto_rest_auth      => FALSE

        );

        COMMIT;

      END;

      /

It is not recommended to configure the sys user. You should use a different user or create an entirely new user with connect and resource privileges.

Comments

Popular posts from this blog

Installing Oracle Database 19c on Linux 8 (OL8) Server

Oracle GoldenGate Real-Time Replication (Unidirectional)

Configuring an Oracle Standby Database