How to Set ORDS 22.1 Configuration Path on Linux for Apache Tomcat

 

How to Set ORDS 22.1 Configuration Path on Linux for Apache Tomcat

When deploying Oracle REST Data Services (ORDS) 22.1 on Apache Tomcat in Linux, a common issue is the dreaded:

404 Not Found
The request could not be mapped to any database

This usually happens because Tomcat doesn’t know where your ORDS configuration directory is located. In Windows, you might have used:

-Dconfig.url=D:\ORDS

via environment variables or JAVA_TOOL_OPTIONS. On Linux, the equivalent setup requires proper environment configuration and file permissions.


Step 1: Set the ORDS Config Path

Create or edit Tomcat’s setenv.sh:

vi /usr/local/tomcat/bin/setenv.sh

Add the following line:

export JAVA_TOOL_OPTIONS="-Dconfig.url=/opt/oracle/ords"

This tells the Java process used by Tomcat exactly where to find your ORDS configuration files.


Step 2: Set Correct Ownership

ORDS config directory must be readable by the Tomcat user:

chown -R tomcat:tomcat /opt/oracle/ords

This ensures that Tomcat can access all files inside the ORDS configuration directory.


Step 3: Set Proper Permissions

Restrict access for security while keeping it readable for Tomcat:

chmod -R 750 /opt/oracle/ords
  • 7 → owner (Tomcat) has full permissions

  • 5 → group can read and execute

  • 0 → others have no access


Step 4: Restart Tomcat

cd /usr/local/tomcat/bin
./shutdown.sh
./startup.sh

Check the logs:

tail -f /usr/local/tomcat/logs/catalina.out

You should see ORDS starting successfully and your database pools being recognized.


Step 5: Verify ORDS URLs

  • Default pool URL:

http://<server-ip>:8080/ords/default/
  • APEX URL:

http://<server-ip>:8080/ords/apex

⚠️ Important: ORDS 22.x requires the pool name in the URL (/ords/default/) — /ords/ alone may return 404.


Conclusion

By setting JAVA_TOOL_OPTIONS to point to your ORDS configuration directory and ensuring proper file ownership and permissions, you can avoid 404 mapping errors and ensure smooth integration with Tomcat. This setup mirrors the Windows environment variable approach, making cross-platform ORDS deployments seamless.

Muhammad Abdullah Al Noor

Muhammad Abdullah Al Noor, An Oracle Apex Consultants and founder of Noors Technology (www.noorstech.com). Core Expertise : Database Administration, Oracle Forms and Reports Development, Oracle Apex Application Designer and Development, Linux Professional etc. Also the owner of TrainerBD Training and OraDemy E-Learning. WhatsApp +8801790721177

Post a Comment

Previous Post Next Post