Install APEX and ORDS on CentOS 8
If you’ve already got a database running on CentOS 8 and want to expose it through Oracle Application Express, this is the quick‑start guide that gets both APEX and ORDS up and running without the usual headache.
1. Make sure the system is ready
Update packages first. That keeps dependencies sane.
sudo dnf update -y
Why it matters: CentOS 8 ships with older packages that sometimes clash with newer Oracle components. Updating pulls in the latest security fixes and library versions.
2. Install Java (the right version)
ORDS requires a JDK 11 or newer, but not 17+ because of some Oracle‑specific classes. The Oracle JDK is fine, but OpenJDK works too.
sudo dnf install java-11-openjdk-devel -y
Why it matters: If you get an “Unsupported major.minor version” error when starting ORDS, the JVM is usually the culprit. Stick to Java 11 and you’re good.
3. Get the Oracle Instant Client
ORDS talks to the database via JDBC. The Instant Client gives the driver without a full Oracle installation.
sudo mkdir -p /opt/oracle/instantclient cd /opt/oracle/instantclient sudo wget https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-basiclite-21.10.0.0.0-linux.x64.rpm sudo rpm -ivh instantclient-basiclite-21.10.0.0.0-linux.x64.rpm
Why it matters: The “basiclite” package is small but enough for ORDS. If you use the full client, you’ll waste space and time.
4. Point Java to the Instant Client
Create a tiny wrapper so that Java knows where the JDBC driver lives:
echo "export CLASSPATH=$CLASSPATH:/opt/oracle/instantclient/libclntsh.so" | sudo tee /etc/profile.d/oracle.sh source /etc/profile.d/oracle.sh
Why it matters: Without this, ORDS can’t load the driver and will exit with a cryptic “ClassNotFoundException.”
5. Download and unzip ORDS
cd /opt sudo wget https://github.com/oracle/ords/releases/download/v21.1.0/ords-21.1.0.zip sudo unzip ords-21.1.0.zip -d ords sudo chown -R $(whoami):$(whoami) /opt/ords
Why it matters: ORDS is a ZIP file, not an RPM, so you need to extract it manually. The chown ensures the user running ORDS owns all files.
6. Configure ORDS
Run the wizard:
cd /opt/ords java -jar ords.war configure -dbuser ords_admin -dbpassword <YOUR_PWD>
What it does: It creates ords.cfg.xml, sets up a data source, and writes an Oracle‑managed schema. If you’re using a non‑default tnsnames entry, supply -tns to point ORDS at the right DSN.
Real scenario: I once ran this command on a fresh CentOS install without setting ORACLE_HOME, and ORDS started but then immediately failed with “ORA-12154: TNS:could not resolve address.” Adding export ORACLE_HOME=/opt/oracle/instantclient before the wizard fixed it.
7. Install Apache or Nginx to serve APEX
For simplicity, use Apache:
sudo dnf install httpd -y
Add a virtual host that proxies /ords/ requests to ORDS’ built‑in Jetty server (usually listening on 8080):
cat <<EOF | sudo tee /etc/httpd/conf.d/ords.conf ProxyPass /ords http://localhost:8080/ords/ ProxyPassReverse /ords http://localhost:8080/ords/ EOF sudo systemctl enable --now httpd
Why it matters: ORDS comes with a lightweight servlet container but you’ll usually want a full‑fledged web server in front for SSL and load balancing.
8. Deploy APEX
Download the latest APEX ZIP, unzip, then run the installer:
cd /opt/ords sudo wget https://download.oracle.com/otn_software/apex/apex-21.2.zip sudo unzip apex-21.2.zip sudo java -jar apex.war install -f apex-21.2/ -p 8080
Why it matters: The installer populates the APEX_210200 schema and registers APEX with ORDS. Skipping the -f flag will prompt you for a password; I prefer to automate so you can script this on new servers.
9. Verify everything works
Open a browser to:
http://<your-server>/ords/f?p=200:1
You should see the APEX login screen. Log in with the APEX_PUBLIC_USER credentials (default password is “ADMIN” or whatever you set during install).
If it hangs, check /opt/ords/logs for error messages. Common pitfalls:
- Wrong Java version => ClassNotFoundException
- Missing ORACLE_HOME => ORA‑12154
- SELinux blocking port 8080 => setsebool -P httpd_can_network_connect 1
10. Harden the setup (optional but recommended)
Enable SELinux policies for Apache:
sudo setsebool -P httpd_can_network_connect_db 1
Create a systemd service to keep ORDS running:
Create /etc/systemd/system/ords.service:
[Unit] Description=Oracle REST Data Services After=network.target [Service] User=$(whoami) Group=$(id -gn $(whoami)) WorkingDirectory=/opt/ords ExecStart=/usr/bin/java -jar ords.war start -port 8080 Restart=on-failure [Install] WantedBy=multi-user.target
Then:
sudo systemctl daemon-reload sudo systemctl enable --now ords.service
Why it matters: It guarantees ORDS restarts after a reboot or crash, and keeps the Java process in its own user space.
And that’s it. You now have a CentOS 8 server hosting APEX behind Apache, all running on Java 11 and Oracle Instant Client. If you hit snags, remember: check environment variables first; they’re often the silent saboteurs.