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
thatjeffsmith
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.

Write A Comment

RSS
Follow by Email
LinkedIn
Share