Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22870

Short URLs impossible to set up with XWiki Debian packages+Jetty

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 17.0.0
    • Configuration
    • Unknown

    Description

      Hi everyone!

      I am trying to set up XWiki as installed via the Debian package, with short URLs. Jetty is used and Nginx is used as reverse-proxy. I followed the [Short URL Guide|https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/ShortURLs/] and the Jetty information when used with a Debian package.

      This means I did the following:

      • Add the Nginx rewrite rules and ensured they are as described in the wiki
      • Modified `/etc/xwiki/xwiki.cfg` so these values are now in effect:

       

      xwiki.webapppath=
      xwiki.defaultservletpath=

       

      • Modified `/etc/xwiki/web.xml` and included this snippet at the very end in the `web-app` block:

       

      <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>/*</url-pattern>
      </servlet-mapping>

       

      • Modified `/etc/xwiki/xjetty-web.xml` to include this XML in the `Configure` block at the very end:

       

      <Set name="contextPath">/</Set>

       

       

      If I now navigate to the website, https://mydomain.tld, it redirects to https://mydomain.tld/xwiki/ and I am greeted with an error 500:

       

      HTTP ERROR 500 jakarta.servlet.ServletException: Failed to extract the Entity Action from URL https://mydomain.tld/xwiki/
      Caused by:
      org.xwiki.resource.CreateResourceTypeException: Invalid standard scheme URL type. The URL is missing a path segment and should be of the format [/<type>/something/...]
      at org.xwiki.url.internal.standard.StandardStringResourceTypeResolver.resolve(StandardStringResourceTypeResolver.java:56)
      at org.xwiki.url.internal.standard.StandardStringResourceTypeResolver.resolve(StandardStringResourceTypeResolver.java:43)
      at org.xwiki.url.internal.DefaultStringResourceTypeResolver.resolve(DefaultStringResourceTypeResolver.java:81)
      at org.xwiki.url.internal.DefaultStringResourceTypeResolver.resolve(DefaultStringResourceTypeResolver.java:45)
      at org.xwiki.url.internal.AbstractExtendedURLResourceTypeResolver.resolve(AbstractExtendedURLResourceTypeResolver.java:89)
      at org.xwiki.url.internal.standard.StandardExtendedURLResourceTypeResolver.resolve(StandardExtendedURLResourceTypeResolver.java:100)
      at org.xwiki.url.internal.standard.StandardExtendedURLResourceTypeResolver.resolve(StandardExtendedURLResourceTypeResolver.java:57)
      

       

      Initially I skipped over these instructions from the Wiki:

      In Jetty, with the default configuration, all it takes is to deploy the XWiki web application in webapps, in a sub directory named root. Note that if you're using the Standalone distribution (which packages Jetty and HSQLDB) then you'll also need to:

      • Remove the existing webapps/root directory which contains a redirect Servlet that automatically redirects root URLs to the xwiki context. You won't need that anymore.
      • Rename the existing webapps/xwiki directory into webapps/root.
      • Remove the jetty/contexts/xwiki.xml file and thus keep only the jetty/contexts/root.xml file. Otherwise you'll get a warning in the console.
        ```

      These did not look relevant to the Debian-package-based installation and I read elsewhere that the Debian package already has the necessary prerequisites. If I am however supposed to actually do as the Wiki says, I will have to perform these changes in `/usr/lib/xwiki-jetty/`. That path being in `/usr/lib` means that every Debian package update will delete the change I did or cause worse issues (since there will be symlinks involved).

      Just for troubleshooting I made these changes anyway though, and it did not help at all. Then I tried a bunch of other things to make Jetty serve XWiki from the root namespace, to no avail - it almost feels like "xwiki" is hardcoded somewhere and I can't get it to work no matter what I try.

      So, I think this has to be some kind of odd bug, or at least, if it's possible somehow and I was just unable to figure it out, would need some documentation.

      What is the correct way to fix this and get XWiki+Jetty+Nginx working on a Debian-package based installation?

      Thank you for making XWiki and looking into this issue!

      Attachments

        Activity

          People

            Unassigned Unassigned
            matk Matthias Klumpp
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: