How to install Oracle Apex on Windows EC2

by | Feb 25, 2021

I recently created an Apex application for a fun project, which gave me the chance to install Apex on windows EC2. Here are the steps I followed to install Apex, having decided to use ORDS (Web Listener) to run Apex.

The version of Oracle Application Express I used is release 20.1 which requires an Oracle Database release 11.2.0.4 or later.

Refer this link for more information about the requirements.

Note: This blog only includes the Oracle Application Express and the ORDS Web listener installation steps and does not include the database installation steps.

Downloading and Installing Application Express

You can download the Apex from the following link. Use apex_20.1_en.zip for English only and apex_20.1.zip for all languages. Note the version number would change when a later version is released.

http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

Unzip the downloaded zip folder

Open command prompt and change the working directory to apex folder where you unzipped the downloaded file. Example: cd C:/apex

Start SQL Plus by typing sqlplus /nolog in your command prompt and connect to the database.

SYSTEM_DRIVE: sqlplus /nolog

SQL> CONNECT SYS as SYSDBA

Enter password: SYS_password

Select the appropriate installation option. Full development environment provides complete access to the App Builder environment to develop applications. A Runtime environment enables users to run applications that cannot be modified.

I installed Full development environment running the @apexins.sql passing the following arguments.

@apexins.sql tablespace_apex tablespace_files tablespace_temp images

Where:

tablespace_apex is the name of the tablespace for the Oracle Application Express application user.
tablespace_files is the name of the tablespace for the Oracle Application Express files user.
tablespace_temp is the name of the temporary tablespace or tablespace group.
images is the virtual directory for Oracle Application Express images.

For example:

@apexins.sql SYSAUX SYSAUX TEMP /i/

When Application Express installs, it creates the following database accounts:

  • APEX_200100 – This account owns the Application Express schema and metadata.
  • FLOWS_FILES – This account owns the Application Express uploaded files.
  • APEX_PUBLIC_USER – This minimally privileged account is used for Application Express configuration with Oracle REST Data Services or Oracle HTTP Server and mod_plsql.
  • APEX_INSTANCE_ADMIN_USER – A minimally privileged account used for the REST Administration Interface.

The second step is to create the Instance administrator account.

Instance administrators are superusers that are responsible for managing an entire Oracle Application Express instance, including managing workspace provisioning, configuring features and instance settings, and managing security. Run the below command to set up the instance administrator account. You may need to provide a username, email address and a password to setup this account.

@apxchpwd.sql

Step three is setting up APEX_PUBLIC_USER. It is important to correctly configure the APEX_PUBLIC_USER account to enable proper operation of Oracle Application Express. The APEX_PUBLIC_USER account is created with a random password in a new installation of Oracle Application Express. Unlock and change password of the APEX_PUBLIC_USER account by running a SQL statement.

ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;

ALTER USER APEX_PUBLIC_USER IDENTIFIED BY <PASSWORD>;

These passwords will be used in the next steps of our installation. So it is important we remember these passwords.

Step four we need to configure RESTfull Services. Provide the password for the users : APEX_LISTENER and APEX_REST_PUBLIC_USER.

@apex_rest_config.sql

Once this is finished Apex installation is done. Just check schema created by the apex installation by running the following queries.

select * from all_users where username like ‘%APEX%’;
select * from all_users where username like ‘%FLOWS%’;

ORDS Installation:

Oracle REST Data Services is a Java EE-based alternative for Oracle HTTP Server and mod_plsql. ORDS support deployment using the following methods

  • Oracle WebLogic Server
  • Apache Tomcat
  • Standalone mode

I used Tomcat to install ORDS.

Download Apache Tomcat: https://tomcat.apache.org/download-90.cgi

It is pretty much straight forward installation if you are using the Windows Service Installer. After installation is complete make sure it is running in the services. Open browser and go to http://localhost:8080/. If you can see Apache Tomcat page your installation was successful.

Lets install ORDS now.

To install ORDS download the latest release of Oracle REST Data services. Unzip the downloaded zip file into a directory (or folder) of your choice.

Next step is to set up your params file. Go to C:ordsords-19.2.0.199.1647paramsords_params.properties and provide the following parameters.

Key Type Description Example
db.hostname string Specifies the host system for the Oracle database. myhostname
db.port numeric Specifies the database listener port. 1521
db.servicename string Specifies the network service name of the database. orcl.example.com
rest.services.ords.add boolean Specifies whether to install the Oracle REST Data Services schema. Set the value to true. Supported values: true, false, (default) true
user.public.password string Specifies the password for ORDS_PUBLIC_USER. password
schema.tablespace.default string Specifies the ORDS_METADATA default tablespace. Specify an existing default tablespace. SYSAUX
schema.tablespace.temp string Specifies the ORDS_METADATA temporary tablespace. Specify an existing temporary tablespace. TEMP
user.tablespace.default string Specifies the ORDS_PUBLIC_USER default tablespace. Specify an existing default tablespace. SYSAUX
user.tablespace.temp string Specifies the ORDS_PUBLIC_USER temporary tablespace. Specify an existing temporary tablespace. TEMP
feature.sdw string Specifies if SQL Developer Web is enabled. Note: For enabling SQL Developer Web, the value of restEnabledSql.active must be true. Default value is false. true
restEnabledSql.active string Specifies if REST-Enabled SQL is enabled. Default value is false. true
plsql.gateway.add boolean Specifies whether to configure Oracle REST Data Services for Application Express. Supported values: true, false, (default) true
db.username string Specifies the PL/SQL gateway username. For Application Express, you must specify APEX_PUBLIC_USER. APEX_PUBLIC_USER
db.password string Specifies the password for APEX_PUBLIC_USER. The password must match APEX_PUBLIC_USER database password. password
rest.services.apex.add boolean Specifies whether to configure Oracle REST Data Services for Application Express RESTful Services. Supported values: true, false, (default). true
user.apex.listener.password string Specifies the password for APEX_LISTENER. If rest.services.apex.add is set to true, you must provide a password for APEX_LISTENER(set up in previous steps). password
user.apex.restpublic.password string Specifies the password for APEX_REST_PUBLIC_USER. If rest.services.apex.add is set to true, you must provide a password for APEX_REST_PUBLIC_USER(set up in previous steps). password
migrate.apex.rest boolean Specifies whether to migrate APEX RESTful Services definitions to Oracle REST Data Services schema. Supported values: true,
false, (default)
true

Below is the sample of my params file.

db.hostname=localhost  
db.port=1521
db.servicename=XE
db.username=APEX_PUBLIC_USER
db.password=MyPassword#123
migrate.apex.rest=false
plsql.gateway.add=true
rest.services.apex.add=true
rest.services.ords.add=true
schema.tablespace.default=SYSAUX
schema.tablespace.temp=TEMP
standalone.mode=false
user.apex.listener.password=MyPassword#123
user.apex.restpublic.password=MyPassword#123
user.public.password=MyPassword#123
user.tablespace.default=SYSAUX
user.tablespace.temp=TEMP
sys.user=SYS
sys.password=MyP@ssw0rd
restEnabledSql.active=true
feature.sdw=true
database.api.enabled=true

Make sure you enter your params correctly.

Change the directory to where ords.war is present and run the below command.

java -jar ords.war configdir C:ordsconf

Once this is complete install ORDS using the below command.

java -jar ords.war

To validate run: java -jar ords.war validate

Copy images from apex download folder (~Downloadsapex_20.1_enapeximages) to tomcat (C:Program FilesApache Software FoundationTomcat 9.0webappsi)

Copy ords.war file from ords download folder (~ords-20.2.1.227.0350ords.war) to tomcat webapps (~webapps).

ORDS installation is done. Go to http://localhost:8080/ords and you can see the below page.

Thanks

Salin

Salin’s our Junior Dev who spends a bunch of time using Oracle Apex.  If you’re a new Apex user you should read about creating a timer item or read some of her other blogs.

0 Comments
Submit a Comment

Your email address will not be published. Required fields are marked *