Unable to have XWiki working in LXC

Hello everybody

It’s 2 days I’m trying to have XWiki working on Debian 12 on LXC on Proxmox. No way.
I set up a Debian12 unprivileged LXC container with 4GB of RAM (planning to switch to 2GB in production) and 2 CPU.
I followed mainly this guide https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/ installingdefault-jdk before, and then xwiki-tomcat10-common and xwiki-tomcat10-mariadb
I tried a couple of times, purging the packages between one and the other, trying with a custom password for DB, leaving password blank in the installation wizard, trying with xwiki-xjetty-mariadb too. Every time I adjusted JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m" in /etc/default/tomcat10and cacheMaxSize="1001760" in /etc/xwiki/xwiki-tomcat10.xml but I wasn’t able to get a working wiki a single time. The closest time I got there, with less tomcat errors, this is the log:

root@wiki:/usr/lib/jvm# systemctl restart tomcat10
root@wiki:/usr/lib/jvm# systemctl status tomcat10
* tomcat10.service - Apache Tomcat 10 Web Application Server
     Loaded: loaded (/lib/systemd/system/tomcat10.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/tomcat10.service.d
             `-xwiki-tomcat10-systemd.conf
     Active: active (running) since Tue 2026-02-10 18:34:18 UTC; 1s ago
       Docs: https://tomcat.apache.org/tomcat-10.0-doc/index.html
    Process: 791 ExecStartPre=/usr/libexec/tomcat10/tomcat-update-policy.sh (code=exited, status=0/SUCCESS)
   Main PID: 795 (java)
      Tasks: 26 (limit: 19092)
     Memory: 133.5M
        CPU: 5.119s
     CGroup: /system.slice/tomcat10.service
             `-795 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat10/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Xmx1024m ->

Feb 10 18:34:19 wiki tomcat10[795]: Command line argument: -Dcatalina.base=/var/lib/tomcat10
Feb 10 18:34:19 wiki tomcat10[795]: Command line argument: -Dcatalina.home=/usr/share/tomcat10
Feb 10 18:34:19 wiki tomcat10[795]: Command line argument: -Djava.io.tmpdir=/tmp
Feb 10 18:34:19 wiki tomcat10[795]: An incompatible version [1.2.35] of the Apache Tomcat Native library is installed, while Tomcat requires at least version [1.3.4] of Tomcat Native 1.x
Feb 10 18:34:19 wiki tomcat10[795]: Initializing ProtocolHandler ["http-nio-8080"]
Feb 10 18:34:19 wiki tomcat10[795]: Server initialization in [589] milliseconds
Feb 10 18:34:19 wiki tomcat10[795]: Starting service [Catalina]
Feb 10 18:34:19 wiki tomcat10[795]: Starting Servlet engine: [Apache Tomcat/10.1.52 (Debian)]
Feb 10 18:34:19 wiki tomcat10[795]: Deploying deployment descriptor [/etc/tomcat10/Catalina/localhost/xwiki.xml]
Feb 10 18:34:19 wiki tomcat10[795]: The path attribute with value [/xwiki] in deployment descriptor [/etc/tomcat10/Catalina/localhost/xwiki.xml] has been ignored

Do you have any advice to have it working?
I know it will be simpler to use the Docker package, but I really hate Docker because I want to know what I’m installing, have full control of the environment where the application runs, and last but not least Docker on Proxmox sometimes has problems in LXC and it’s too resource hungry in VM.

Thank you!

Nothing in that log suggest any fatal problem, but it seems to stop right before actually starting initializing the xwiki application. Maybe you have other log somewhere else (but I would have expected to at least see the tomcat init end log, good or bad, even if your Tomcat is configured to put the applications related log in other files).

Tbh I really looked for other logs, but I can’t find any other relevant path containing logs for xwiki or tomcat. I think I looked in the wrong paths, if you could point me to the right path I’ll check and report back.

This is further tomcat log:

Feb 10 18:34:19 wiki tomcat10[795]: Deploying deployment descriptor [/etc/tomcat10/Catalina/localhost/xwiki.xml]
Feb 10 18:34:19 wiki tomcat10[795]: The path attribute with value [/xwiki] in deployment descriptor [/etc/tomcat10/Catalina/localhost/xwiki.xml] has been ignored
Feb 10 18:34:21 wiki tomcat10[795]: One or more listeners failed to start. Full details will be found in the appropriate container log file
Feb 10 18:34:21 wiki tomcat10[795]: Context [/xwiki] startup failed due to previous errors
Feb 10 18:34:21 wiki tomcat10[795]: Deployment of deployment descriptor [/etc/tomcat10/Catalina/localhost/xwiki.xml] has finished in [1,923] ms
Feb 10 18:34:21 wiki tomcat10[795]: Deploying web application directory [/var/lib/tomcat10/webapps/ROOT]
Feb 10 18:34:22 wiki tomcat10[795]: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded >
Feb 10 18:34:22 wiki tomcat10[795]: Deployment of web application directory [/var/lib/tomcat10/webapps/ROOT] has finished in [967] ms
Feb 10 18:34:22 wiki tomcat10[795]: Starting ProtocolHandler ["http-nio-8080"]
Feb 10 18:34:22 wiki tomcat10[795]: Server startup in [2970] milliseconds

What could I check first to troubleshoot this problem?

That log suggests that the initialization of the XWiki application went fine, so you should be able to access it (generally on port 8080 and under /xwiki if you did not change any configuration).

But XWiki init is supposed to produce log that we don’t see here, apparently. So I guess it’s somewhere else, but apart from /var/log/tomcat10/, I don’t have much idea of where to look. I have a pretty standard Debian 12 and I find everything in /var/log/tomcat10/catalina.out (both Tomcat and XWiki log). Might worth checking the system log, maybe (not much of an expert, but I guess it should be something like sudo journalctl -xeu tomcat10).

No way. I tried to install a new Debian 12 VM (instead of unprivileged LXC) and the result is the same:
https://pastebin.com/Xs4gUGg9
It’s a pity because I really found in Xwiki the features I needed but if I can’t install it…

That’s new. /etc/tomcat10/Catalina/localhost/xwiki.xml is supposed to be a symlink targeting /etc/xwiki/xwiki-tomcat10.xml (all of which is supposed to be provided by xwiki-tomcat10-common).

To be hones this time I didn’t install explicitly xwiki-tomct10-common, because in the installation documentation it’s not listed to install it (I found an external site with installation documentation that told to install it previous tme). It’s only indicated a list of packages with the features of every one and the xwiki-tomcat10-common tells is if you want to set up the database by yourself (that I don’t want), so I only installed xwiki-tomcat10-mariadb with all defaults and hoped that if xwiki-tomcat10-common was a dependence, it would have been installed by itself.

In the meanwhile I’m trying docker version too on docker on LXC and I’m having problems with that too: the webpage opens, says “xwiki starting 12%”, and then crashes with a page full of java errors.

It is a dependency, and it is installed automatically (as apt probably told you before you confirm the install).

root@Xwiki:/etc/tomcat10/Catalina/localhost# ls -ll
total 0
lrwxrwxrwx 1 root tomcat 29 Feb 23 14:56 xwiki.xml -> /etc/xwiki/xwiki-tomcat10.xml
root@Xwiki:/etc/tomcat10/Catalina/localhost#

This is the VM installation. The symlink is there.

Yeah, I didn’t noticed that during installation but of course if it’s a dependency it should have been installed.

And /etc/xwiki/xwiki-tomcat10.xml exists too ?

root@Xwiki:/etc/xwiki# ls -ll
total 204
drwxr-xr-x 3 root root  4096 Feb 23 23:59 cache
drwxr-xr-x 2 root root  4096 Feb 24 00:00 fonts
-rw-r--r-- 1 root root 16610 Feb 24 00:01 hibernate.cfg.xml
-rw-r--r-- 1 root root  2426 Feb 23 14:54 jboss-deployment-structure.xml
-rw-r--r-- 1 root root  2174 Feb 23 14:54 jetty-ee10-web.xml
-rw-r--r-- 1 root root  2174 Feb 23 14:54 jetty-ee11-web.xml
-rw-r--r-- 1 root root  3835 Feb 23 14:54 logback.xml
drwxr-xr-x 3 root root  4096 Feb 23 23:59 observation
-rw-r--r-- 1 root root  2076 Feb 23 14:54 portlet.xml
-rw-r--r-- 1 root root  1328 Feb 23 14:54 sun-web.xml
-rw-r--r-- 1 root root    15 Feb 23 14:54 version.properties
-rw-r--r-- 1 root root 17793 Feb 23 14:54 web.xml
-rw-r--r-- 1 root root 25618 Feb 23 14:54 xwiki.cfg
-rw-r--r-- 1 root root   119 Feb 23 14:54 xwiki-locales.txt
-rw-r--r-- 1 root root 89234 Feb 23 14:54 xwiki.properties
-rw-r--r-- 1 root root  2377 Feb 24 00:07 xwiki-tomcat10.xml
root@Xwiki:/etc/xwiki#

root@Xwiki:/etc/xwiki# cat xwiki-tomcat10.xml
<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 *
-->

<!--
  Context configuration file for the XWiki Web App

  This file is used only for Tomcat9 deployment of XWiki via debian packages.
  It is equivalent to, and needs to be kept up to date with traditional
  deployment file:
  xwiki-platform/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/META-INF/context.xml

  Prevent JAR scanning and disable JSP support in order to optimize Tomcat startup time. Note that we keep WebSocket
  support enabled because it is needed by the real-time editing.
  See https://wiki.apache.org/tomcat/HowTo/FasterStartUp &
  https://tcollignon.github.io/2016/02/09/Accelerate-tomcat-78-start-up.html
  (sections "Disable scanning the web application", "Disable scanning web-fragment jar", "Excludes jars for scanning",
  "Disable JSP support")
-->
<Context path="/xwiki" docBase="/usr/lib/xwiki" containerSciFilter="org.apache.jasper.servlet.JasperInitializer">

  <!--
       Until implementation XCOMMONS-2369 in order to make symlinks work in Tomcat,
       we have to manually increase the cache size value to higher value
       that stop causing catalina.out warnings on "evicting expired cache entries".
  -->
  <Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="1001760"/>

  <!-- Disable JAR scanning since XWiki does not need that -->
  <JarScanner scanClassPath="false">
    <JarScanFilter defaultTldScan="false"/>
  </JarScanner>
</Context>
root@Xwiki:/etc/xwiki#

https://pastebin.com/uq05QHx7

This is the log from the LXC installation. Debian 12, fully updated, nesting enabled.

I prefer to have it working in an LXC to be honest if it’s possible, due to the less overhead.

Then it’s not clear to me why Tomcat complains it does not exist.

Especially since it apparently complain a few logs after about something which is located in that file (this is an expected warning).

Thank you
Ok, so… I tried to install an unnumbered amount of VMs, LXCs, with nesting on, with nesting off, with Debian 12, Ubuntu 24.04, Docker in LXC, and I didn’t manage to have one single installation that was usable.
Could you please point me to the most safe combination of factors to have Xwiki working? And maybe to an installation guide to manage that?
If I could choose, I prefer to have it installed directly on an LXC container, without docker.
I’m really thinking about switching to a previus OS like ubuntu 22.04 or Debian 11 and try to install a Tomcat9 or whatever else and see if that works.

Not sure what to tell you, AFAIK Debian packages just work in most Debian-based distributions and many people use them. The official guide is https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/, and it should have everything you need in theory.

Maybe double check https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/#HTomcat.

I tried to install xwiki-tomcat9-mariadb on Debian 11 but it refused to install cause of different versions from what downloaded by the manifest (v 16.something) and what would have been installed (v18.something).
So I tried xwiki-xjetty-mariadb on Debian 11 and it installed but didn’t start due to openjdk 17 installed (and java 21 required).
So I switched back to Debian 12, removed all the xwiki-tomcat10-mariadb packages and tried with xwiki-xjetty-mariadb and it installed but with the same java version problem. So I installed java21 via Oracle deb package and finally something worked!
Now I’m able to access the webpage (a part from the fact it took ages to open with the % slowly increasing from 12% to 100%, I hope that’s only the behavior of the first access on a freshly installed system), I wonder if with java21 even the tomcat10 version would have worked.

You mean XWiki 18.1.0 ? XWiki 18+ indeed require Java 21 and definitely won’t work with Java 17 (contrary to XWiki 17.10.x, the LTS). But trying to run an application that require an higher version of Java generally produce a very explicit error in the log (it’s definitely not what causes this strange problem with xwiki.xml).

Indeed, it seems the 18.x package only have a constraint on Java 17, while it should have been updated to 21 for 18.0.0. Fixing that now.