Configure APEX on port 80 when using EPG (Linux)

By default, Oracle XE comes with Embedded PLSQL Gateway (EPG) web server and the default port for APEX is 8080. To change that to port 80, use the following steps.

Step 1. Chage the owner of tnslsnr folder

As root, execute:

$ chown root:root $ORACLE_HOME/bin/tnslsnr


Step 2. Modify LISTENER.ORA

Add this to your LISTENER.ora (located in $ORACLE_HOME\NETWORK\ADMIN):

(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 80))

Step 3. Restart the listener

Restart the listener in background, using the root user as owner. user_id and group_id are the user and group of the root user. You can get these by running id -a

$ lsnrctl stop
$ tnslsnr LISTENER -user user_id -group group_id &

Don't start the listener with lsnrctl start. It won't work anymore because of the operation done at step 1!

Step 4. Set the port in the XDB configuration file

Connect to sqlplus using sys user. Execute:

SQL> exec DBMS_XDB.setHTTPPort(80);

Re-register the listener:


Exit sqlplus.

Step 5. Check if APEX works on port 80

First, check if the Oracle Listener is started and working correctly:

$ lsnrctl status

Then, APEX should be accessed via URL without specifying port 8080:

http://hostname.apex (instead of http://hostname.apex:8080)

Leave a Reply