Setting up Oracle REST Data Services (ORDS) with Apache Tomcat is a crucial step if you want to run Oracle APEX in a modern web environment. This guide walks you through a clean installation, configuration, and deployment process on Oracle Linux.
🔧 Step 1: Prepare Environment (Root User)
Switch to root user and clean previous ORDS installation:
cd /root
cd /opt/oracle
# Remove old ORDS (if exists)
rm -rf ords
# Create fresh directory
mkdir -p /opt/oracle/ords
# Install unzip if not installed
yum install -y unzip
# Extract ORDS package
unzip ords-22.1.0.105.1723-COMPATIBLE-FOR-APEX_23.1.zip -d /opt/oracle/ords
# Move into ORDS directory
cd /opt/oracle/ords
# Create config directory
mkdir config⚙️ Step 2: Set Proper Ownership & Permissions
Make sure Oracle user has full control:
chown -R oracle:oinstall /usr/local/tomcat
chown -R oracle:oinstall /opt/oracle/ords
chown -R oracle:oinstall /opt/oracle/ords/config
chmod -R 750 /opt/oracle/ords🧑💻 Step 3: Switch to Oracle User & Install ORDS
su - oracle
cd /opt/oracle/ords
# Optional: Clean uninstall (if previously installed)
java -jar ords.war uninstall
# Install ORDS
java -jar ords.war --config /opt/oracle/ords/config install⚠️ Important:
- When prompted, use:
- Service Name:
XEPDB1(for Oracle XE)
- Service Name:
- Provide correct SYS / SYSTEM credentials
🚀 Step 4: Deploy ORDS to Apache Tomcat
cp -a /opt/oracle/ords/ords.war /usr/local/tomcat/webapps/🎨 Step 5: Configure APEX Static Images
APEX requires static files (CSS, JS, images) to render properly.
cd /usr/local/tomcat/webapps
# Create images directory
mkdir i
# Copy APEX images
cp -a /opt/oracle/apex/images/. /usr/local/tomcat/webapps/i/🔗 Step 6: Configure Tomcat (server.xml)
Edit Tomcat configuration:
cd /usr/local/tomcat/conf
vi server.xmlFind this section:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">Add the following line inside <Host>:
<Context docBase="/opt/oracle/apex/images/" path="/i/" />This ensures APEX static resources are served correctly.
🔄 Step 7: Restart Apache Tomcat
cd /usr/local/tomcat/bin
./shutdown.sh
./startup.sh✅ Final Check
Open your browser:
http://your-server-ip:8080/ordsIf everything is configured correctly, Oracle APEX should load successfully.
💡 Pro Tips
- Always ensure database is OPEN
Verify listener and service name:
SELECT name FROM v$services;- Check logs if errors occur:
- ORDS logs:
/opt/oracle/ords/config/logs - Tomcat logs:
/usr/local/tomcat/logs
- ORDS logs:
🎯 Conclusion
You now have a fully working ORDS + APEX environment using Apache Tomcat. This setup is production-ready with further enhancements like:
- SSL (HTTPS)
- Domain mapping
- Reverse proxy (Nginx)
