database icon indicating copy to clipboard operation
database copied to clipboard

Change the base path of the blazegraph service

Open huikang opened this issue 5 years ago • 5 comments

Is there a way to change the base path of the blazegraph service? For example, instead of using http://localhost:9999/blazegraph/, I'd like to configure the URL like http://localhost:9999/new-blazegraph-base-path/. Thanks.

huikang avatar May 07 '20 14:05 huikang

You can put it behind a reverse proxy configuration or edit the jetty.xml file to deploy the existing war to a different location.

beebs-systap avatar May 07 '20 15:05 beebs-systap

@beebs-systap , regarding the second approach, could you please provide any exemplar file and the command to start the service? Thanks.

huikang avatar May 07 '20 16:05 huikang

Sure, here's how to specify the override. If you are using the war file only, you can just rename it to the path you'd like.

beebs-systap avatar May 07 '20 16:05 beebs-systap

Cool. I am new to Jetty; which value shall I override in the configuration file (web.xml)?

huikang avatar May 07 '20 17:05 huikang

Hello, would it please be possible to have any update on this? I have tried for example the below XML, but it doesn't seem to work:

  • Adding -Djetty.overrideWebXml=/var/lib/blazegraph/override-web.xml as a startup option
  • Having the following content in the override-web.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">
    <Configure id="WebAppContext" class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="contextPath">/my-path</Set>
    </Configure>
    

I see the contextPath is set here: https://github.com/blazegraph/database/blob/3127706f0b6504838daae226b9158840d2df1744/blazegraph-jar/src/main/resources/jetty.xml#L255

But the contextPath is not present in the web.xml. Sorry for bumping a 1 year old issue, any advice is much appreciated.

carolili avatar Jul 30 '21 15:07 carolili