Oracle APEX on Apache Tomcat

Referred documents

https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-installation-on-tomcat-windows

Oracle keeps releasing new versions of both APEX and ORDS once in couple of months, if not weeks. Posting a fresh article for each and every other version looks pretty hectic and I have decided to maintain a single post with specific instructions for versions that I tested at lab. Please refer “Install APEX on Windows” for details about installing APEX on Windows.

Assuming the APEX with ORDS installation all good, we will see how to setup ORDS using Apache Tomcat now. Please note, Apache Tomcat 9.x is the latest version supported by ORDS. You can read about the differences between Tomcat 9 and Tomcat 10 here (As on 23rd Dec 2023, Tomcat10 doesn’t work with ORDS)

I suggest going with the Zip package. You can opt for the Windows Service installer, if you are setting APEX for regular development or PRODUCTION usage. Please refer the following link for detailed information about setting up Apache Tomcat on Windows. https://phoenixnap.com/kb/install-tomcat-window

Let’s setup Apache Tomcat for ORDS now, assuming Apache Windows Service is not installed.

I have the Tomcat 9 software extracted to the folder to D:\apache-tomcat. Please make sure that you will setup the server.xml with ports that are freely available on your system prior attempting to start the web server.

The following are the areas you must thoroughly confirm within the server.xml file that is available in “conf” folder.

Let’s quickly make some minor change to web.xml, allowing directory browsing. We’ll change the listing parameter value from “false” to “true”

There are many other changes we must make for a PRODUCTION instance. For the current purpose, this is enough to start with.

Now, we will quickly copy the ORDS and APEX images to Tomcat apps section so that they could be mapped.

  1. Copy “ords.war” from the ORDS installation source to webapps
  2. Copy the “images” folder from APEX installation source & rename it to “i”
  3. Refer the below image for details.

From an elevated command prompt, switch to Apache Tomcat BIN folder. We need to setup some environment variables prior starting Tomcat server.

D:\apache-tomcat\bin>set JAVA_HOME=C:\Java\jdk-17 --JDK path

D:\apache-tomcat\bin>set ORDS_CONFIG=D:\ORDS\config --location that was selected for configuring ORDS, this location has all details for database connection and more.

D:\apache-tomcat\bin>set JAVA_OPTS="-Dconfig.url=%ORDS_CONFIG%" -Xms1024M -Xmx2G --Dconfig.url is the place where Tomcat server looks for ORDS configurations. Finaly Xms and Xmx are the JAVA min and max memory settings. For PRODUCTION, these parameters should be configured precisely to avoid performance bottlenecks.

D:\apache-tomcat\bin>startup --will start the web server.

Let us try to access ORDS now. The below is the landing page, from which you can start SQL Developer Web APEX and ORDS authentication.

You can use “shutdown.bat” to stop the Tomcat server.

If set is expected to be used for longer intervals, we can install Tomcat as Windows Service. Please note the forward slashes “/”. Oracle allows both forward and backward slashes for these kind of settings.

Note the service name “Tomcat9”. You should use the same name, so that the service configuration executable(tomcat9w.exe) can be used for setting up ORDS specifics at post service installation.

Once the service installed, let us quickly move to Tomcat bin folder. Open “tomcat9w.exe”

let’s configure the JAVA options section with the “-Dconfig.url”, pointing to the ORDS config path.

Start the “Apache Tomcat 9.0 tomcat9” Windows service now. Set the service to start manually or automatic based on your requirements. Remember, ORDS will not start if the database instance is not open.