ORDS logo
GET, POST, PUT, DELETE your way in and out of Oracle Database.

It used to be if you wanted the base URI for any resource served by ORDS to be something other than /ords, you would simply rename the .war file.

For example, if you wanted to see URLs like:

https://mydomain.com/apex/... 

vs

https://mydomain.com/ords/...

…you could simply rename ords.war to apex.war.

That won’t work in versions 22.1 and higher.

If you do it anyway…on Windows

The exe will fail as it’s hardcoded to look for ords.war in the ORDS ‘home.’

Doh!

If you do it anyway…on Linux or OS X is a bit more forgiving, the script simply looks for a war file in the ORDS Home directory, but it does NOT use the name of the war file to set the context path for ORDS resources (how Jetty Webserver knows you want ORDS item vs a static html/cs/js file.)

So ORDS will start, but no bueno when you call something using your new URL.

I’m not a narcissist, I just play one online.

So on my Mac, the script still works (it just looks for any war file in the ORDS Home directory), but changing the name has no effect on the base path for the ORDS served addresses.

Tip: When setting the context path do not forget the leading / – or it will not work!

Just update the config

Using the ‘config set’ command, I can tell ORDS what I want the paths to start with. Now, the default is /ords, which you can see if you use the ‘config list’ command.

c:\ORDS\22.2\bin>ords --config c:\ords\22_config config set standalone.context.path /thatjeffsmith

ORDS: Release 22.2 Production on Wed Jul 20 18:12:30 2022

Copyright (c) 2010, 2022, Oracle.

Configuration:
  /C:/ords/22_config/

The global setting named: standalone.context.path was set to: /thatjeffsmith

Now with that set, when I startup ORDS…

I can see the setting has been applied in my stdout:

Good, good.

And I can now start using ORDS just like before, except the beginning of all my URIs start with /thatjeffsmith instead of /ords.

Any link that ORDS generates will also observe this setting.

It took mom and dad like 3 days to come up with ‘Jeff,’ true story.

Alternatively use –context-path flag for serve command

ords --config c:\ords\22_config serve --context-path /justjeff
This flag will OVERRIDE the current standalone.context.path setting.

When someone asks me if I’m ‘that Jeff Smith,’ my stock answer is, I’m just Jeff.

That’s for standalone, what about Tomcat or WLS?

We have very specific instructions for preparing the runtime environment, configurations files, and yes, the war file for Tomcat and WLS.

My Advice

  • Make sure you’re on 22.2 – much easier than 22.1
  • Read the Docs
Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

8 Comments

  1. We upgrade Apex to 22.2 and ORDS to 21.4. We renamed ords.war to apex.war. Due to the version of ORDS is 21.4. Rename will not have any impact on ORDS deployment? Thanks

  2. We are trying to migrate to Ords 23 from 21, using Weblogic. Are you saying its hardcoded to ords.war, can’t we created it with a customized names, ie

    ords –config /ords/config/dir/ords_config war /ords/webapp_config/apex22dev.war

    Additionally, you say we can’t have multiple war files in the same directory, ie the config directory. I created my i.war file in config directory. Will that not work? I also have a c.war for a “custom images” context-path declaration.

  3. So, with Windows we can’t rename the file but instead must “set standalone.context.path”.

    On Unix/Linux we could rename the file, but we actually don’t need to, we only need to set standalone.context.path.

    In either case, nothing happens to the .war file, it’s just the configuration file that gets updated, right?

    • We’re both right.

      I’m talking about standalone ORDS. They’re doing it for Tomcat.

      Don’t rename the ords.war file in the bin directory of ORDS, AND do not put any other war files in that directory.

Write A Comment