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:
…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.’
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.
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:
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.
Alternatively use –context-path flag for serve command
ords --config c:\ords\22_config serve --context-path /justjeff
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.
- Make sure you’re on 22.2 – much easier than 22.1
- Read the Docs
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?
Thanks for the post. Good to know this should no longer be done, but I just seen the Youtube video from Skillbuilders where they do exactly this rename and it seems to be working fine. So a bit confused 😉
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.