Oracle Rest Data Service (ORDS) URL link

2019-09-13 20:57发布

问题:

I have installed ORDS 3.0 on Centos 7 and using it in standalone mode, but I am currently having two issues:

  • The URL contains /ords, e.g.: http://localhost/ords. I want to change it to /apex instead. I have tried renaming ords.war to apex.war, but the URL hasn't changed.

  • I am unable to start ORDS at system boot. I have created a systemctl service for it, but ORDS stops after starting.

回答1:

The specific version of ORDS can be important, things do change quite a bit from version 3.0 to 3.9 for example.

However...

Starting ORDS in your init tab scripts is pretty much like anything else, you should be able to nohup it and redirect the output to a log file. If you're doing this, what's the log file showing, WHY is it stopping after it starts?

And the URL's - since you're running ORDS in standalone mode, you can take advantage of the embedded Jetty webserver that's being used.

That means you can config how URI's are rewritten. Kris has an example of how to do this here.

How to map /catalog to /ords/klrice/metadata-catalog/

<Call name="addRule">
         <Arg>
           <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
             <Set name="pattern">/catalog</Set>
             <Set name="replacement">/ords/klrice/metadata-catalog/</Set>
           </New>
         </Arg>
       </Call>
</Ref>