Installing Oracle APEX on Oracle XE

This installation is based on the latest Centos 6 build

There is also a new install guide based on the 4.11 Apex and 11g Oracle Installing Oracle 11g XE and Apex 4.11 in Amazon AWS, even though you are looking at Centos or one of the other Linux distributions it maybe worth having a look at this one as it is more comprehensive and also for the newer version. They are very similar in the steps but where 4.01 had some error 4.11 has been updated.

cat /etc/redhat-release = CentOS Linux release 6.0 (Final)

Download the xe server and client, for this install I am using the release 10 as my main database is 10gR2 and I hope to port this into the live environment at some point.

As usual I downloaded all the rpm, zip files into /software

So download the relevant xe server and client

Download oracle-xe-

Download oracle-xe-client-

These can be found here

For this install you also need the latest JDK (I tried many times to get APEX working so not quite sure if you need this but I don’t think it does any harm)

Download jdk-6u27-linux-i586.rpm

It is work noting that these instructions have been based on the install instructions for APEX, APEX listener and the Glassfish server

The steps are as follows :

Install oracle and configure

Install APEX into oracle

Install Glassfish server & APEX

Install Oracle Listener

Install oracle

rpm -i oracle-xe-client- oracle-xe-

Once installed it will display

Executing Post-install steps…

You must run ‘/etc/init.d/oracle-xe configure’ as the root user to
configure the database.

Executing Post-install steps…

Add these lines to the .bashrc file

cd ~

vi .bashrc

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

export $PATH


Configure Oracle

/etc/init.d/oracle-xe configure

Oracle Database 10g Express Edition Configuration
This will configure on-boot properties of Oracle Database 10g Express
Edition.  The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts.  Press <Enter> to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]: Enter

Specify a port that will be used for the database listener [1521]: Enter

Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration: Enter password (do not lose)

Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: Enter

Starting Oracle Net Listener…Done
Configuring Database…

NOTE to stop and start XE use

service oracle-xe start

service oracle-xe stop

We need to change some parameters in Oracle

sqlplus sys/(password)@//localhost/xe as sysdba



service oracle-xe restart

Install APEX into Oracle

Download the APEX software (at the time of writing this was version 4.1), as stated before I have downloaded mined to /software

cd /software/apex_4.1_en/apex

sqlplus sys/(password)@//localhost/xe as sysdba

@@apexins.sql SYSAUX SYSAUX TEMP /i/


Enter a password for the ADMIN user Enter admin password that you want




Install Glassfish server

Download the latest Glassfish server from Oracle from here

Again I downloaded this to /software

cd  /software

mkdir glassfish

cp glassfish/

cd  glassfish


cp -r glassfish3 /opt/

mkdir /opt/glassfish3/glassfish/domains/domain1/docroot/i

Note: The ‘i’ directory is very important, again not from any notes that I have seen, might have missed this. Got it from a YouTube demo installation.

cd /software/apex_4.1_en/apex/images

cp -r * /opt/glassfish3/glassfish/domains/domain1/docroot/i

cd /opt/glassfish3/glassfish/bin

./asadmin start-domain

You may get this error

Waiting for domain1 to start ……..Error starting domain domain1.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:

Launching GlassFish on Felix platform
Oct 3, 2011 1:44:29 PM com.sun.enterprise.server.logging.LogManagerService postConstruct
WARNING: Record begin marker is not a proper value so using default.
Oct 3, 2011 1:44:29 PM com.sun.enterprise.server.logging.LogManagerService postConstruct
WARNING: Record end marker is not a proper value so using default.
Oct 3, 2011 1:44:29 PM com.sun.enterprise.server.logging.LogManagerService postConstruct
WARNING: Log Format field separator is not a character so using default.
[#|2011-10-03T13:44:30.196+0100|INFO|oracle-glassfish3.1.1||_ThreadID=10;_ThreadName=main;|Registered for persistence-type = replicated in BackingStoreFactoryRegistry|#]

[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1||_ThreadID=12;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 281ms – bound to []|#]

[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1||_ThreadID=11;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 339ms – bound to []|#]

[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1||_ThreadID=13;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 406ms – bound to []|#]

[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1||_ThreadID=14;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 243ms – bound to []|#]

[#|2011-10-03T13:44:31.374+0100|INFO|oracle-glassfish3.1.1||_ThreadID=10;_ThreadName=main;|Oracle GlassFish Server 3.1.1 (12) startup time : Felix (3,647ms), startup services(2,020ms), total(5,667ms)|#]

[#|2011-10-03T13:44:31.377+0100|SEVERE|oracle-glassfish3.1.1||_ThreadID=10;_ThreadName=main;|Shutting down v3 due to startup exception : No free port within range:|#]

[#|2011-10-03T13:44:31.781+0100|INFO|oracle-glassfish3.1.1||_ThreadID=15;_ThreadName=Thread-21;|Server shutdown initiated|#]

[#|2011-10-03T13:44:31.812+0100|INFO|oracle-glassfish3.1.1||_ThreadID=15;_ThreadName=Thread-21;|Already stopped, so just returning|#]

Command start-domain failed.

If you do, then delete then the default doamin needs to be recreated

./asadmin delete-domain domain1

./asadmin create-domain –nopassword domain

./asadmin start-domain

Copy the files etc  again

The successful output should look like this

Waiting for domain1 to start ……..
Successfully started the domain : domain1
domain  Location: /opt/glassfish3/glassfish/domains/domain1
Log File: /opt/glassfish3/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

You now have a working Glassfish server ready for the listener and Apex to be deployed.

Configure Glassfish

Navigate to http://FQDN:4848 (where FQDN is your DNS server name)

Change the admin password to start with

Click on domain and then choose the Administrator Password tab

Do not forget to press Save

We now need to create two users:

Pick Configuration

Pick Server-config

Pick Security

Select the check box next to Default Principal to Role Mapping.


Pick Realms

Pick File

Manage Users Button

New Button

User ID: managerlistener

Group List: Manager

New Password:

Confirm New Password:


New Button

User ID: adminlistener

Group List: Admin

New Password:

Confirm New Password:


Install Oracle Listener

You should have already downloaded the listener

Select Applications

Click Deploy

Navigate to the downloaded Apex Listener folder and find apex.war file

Click OK

To find the URL that the site will operate on, make sure that you are still in the Applications section from where you deployed the apex.war file. Click on the Launch link under action

This will open a new browser window with the server links, I have two



Listener Configure

This area was a little bit of an issue and I still am not quite sure on how it worked in the end to be honest. If you follow the instructions then all should go well. I in stalled this software about six-times on the same server so some of the config was left behind and I am not sure where one of the important files is stored.

The instructions give you the following urls




I have yet to get the Status to work (that’s another day)

To configure the listener

Navigate to http://FQDN:8181/apex/listerConfigure


Password: As per what was set  above with the SQL script

Connection Type: (Mine is basic)

Hostname: FQDN of the sever



The assumption is that you did not change any of the defaults when installing Oracle.

The next bit was the hardest bit, as I am not sure where the documentation is for this, all of this has been gleaned from various bits and pieces.

If you get the dreaded

HTTP Status 403 – Requested url http://:8080/apex/wwv_flow.accept is not allowed.

then the chances are it has something to do with this setting

The following are the settings that I used to get it up and running, if you find any more documentation around this subject please drop me a line.

Security Tab

Allowed procedures

wwv_flow_file*,www_flow_file*, p, n, cust*, apex*, f, wwv*,www*

As soon as you press the Apply button you should see the APEX screen. There are many sources, but there is not one definitive source that I have found. Hopefully this information will add to what is already out there and help others.

Stay tuned to see if I can now develop in this stuff 🙂 more posts will be available.

Hope that you get it working and if you need help drop me a line and I will see if I can give you a hand



2 Comments on “Installing Oracle APEX on Oracle XE”

  1. SEB says:

    Hi Alistair!

    Awesome job!

    I had glassfish and Apex 4.02 configured successfully before and tried to do the same configuration only with XE on Ubuntu. Finally I stumbled upon the 403 error, I didn’t experience earlier!
    You basically saved me from rolling my installation back! Thanks again!

    Perhaps you know how to get the glassfish server and ApexListener run automatically on startup?

    If you do please drop a line!



  2. […] APEX | Tags: Amazin AWS, APEX, EC2, Oracle |Leave a comment » I have written about how to install Apex and XE on Linux, this one takes those thoughts and applies them to Amazon […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s