Deploy XWiki as the Root Web Application

Last modified by Eleni Cojocariu on 2026/10/30 18:38

Steps

Deploy XWiki at the servlet container's root context so that its URLs stop carrying the /xwiki/ application name, the first of the three parts described in Short URLs.

  1. Stop XWiki.
  2. Deploy the XWiki web application at the container's root context, whose name differs per container.

    Tomcat

    mv webapps/xwiki webapps/ROOT

    Jetty

    mv webapps/xwiki webapps/root

    XWiki Standalone distribution, where webapps/root already exists and holds a servlet that redirects the root URL to /xwiki/, so remove it first

    rm -r webapps/root
    mv webapps/xwiki webapps/root
  3. Set xwiki.webapppath to an empty value in xwiki.cfg.
    xwiki.webapppath=
  4. Start XWiki.
  5. Open any page and read its URL. The application name is gone, while the servlet mapping and the action are still there.
    http://server.com/bin/view/Sandbox/WebHome

FAQ

Why does the root context have a different name in each container?

There is no servlet standard for the root web application, so every container names and detects it in its own way.

Do I really have to set xwiki.webapppath?

Yes. XWiki cannot derive the context path from the URL once it is deployed at the root, and leaving the property unset causes intermittent failures that depend on which URL reached the instance first.

I installed XWiki from the Debian package. Does this procedure apply?

No. The Debian packages deploy XWiki themselves and have their own root-webapp procedure, linked below.

Related

Get Connected