Version 248.1 by Thomas Mortagne on 2025/01/30

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc start="2"/}}
3 {{/box}}
4
5 This distribution allows installing XWiki and every component needed for a production instance automatically.
6
7 This method works for all Debian-based linux distribution. Feel free to use [[the User Forum>>dev:Community.Discuss]] to report issues, or discuss about it.
8
9 {{warning}}
10 Before XWiki 17, a critical dependency of the XWiki Tomcat Debian packages was **tomcat9**. Unfortunately Debian decided to remove the ##tomcat9## package to keep only ##tomcat10## starting with Debian 12 (bookworm) and Ubuntu 24.04. The current alternatives are:
11
12 * use the xjetty based packages instead
13 * upgrade to XWiki 17+
14 * use an [[alternative non Debian specific install method>>xwiki:Documentation.AdminGuide.Installation||anchor="HInstallationMethods"]].
15 {{/warning}}
16
17 == APT Configuration ==
18
19 First, you have to configure your package manager in order to use XWiki's repository. This can be done simply, using this command:
20
21 {{code language="bash"}}
22 sudo wget https://maven.xwiki.org/xwiki-keyring.gpg -O /usr/share/keyrings/xwiki-keyring.gpg
23 sudo wget "https://maven.xwiki.org/stable/xwiki-stable.list" -O /etc/apt/sources.list.d/xwiki-stable.list
24 {{/code}}
25
26 {{info}}
27 Note that there is several repositories you can choose (as alternatives to the stable one you have in the previous example):
28
29 * [[https:~~/~~/maven.xwiki.org/releases/xwiki-releases.list>>https://maven.xwiki.org/releases/xwiki-releases.list]]: all released versions including milestones and release candidates (beta)
30 * [[https:~~/~~/maven.xwiki.org/stable/xwiki-stable.list>>https://maven.xwiki.org/stable/xwiki-stable.list]]: all released versions excluding milestones and release candidates (stable)
31 * [[https:~~/~~/maven.xwiki.org/lts/xwiki-lts.list>>https://maven.xwiki.org/lts/xwiki-lts.list]]: the current "long term support" branch versions as defined in [[Support page>>xwiki:Main.Support]]
32 {{/info}}
33
34 Now you can update the packages database to read the data from this repository.
35
36 {{code language="bash"}}
37 sudo apt-get update
38 {{/code}}
39
40 Now you can make a little search to see what this repo offers.
41
42 {{code language="bash"}}
43 apt-cache search xwiki
44 {{/code}}
45
46 * Common packages not tied to any application server or database
47 ** ##xwiki-common## - XWiki, you can install this if you want to take care yourself of the database and application server
48 ** ##xwiki-mariadb-common## - XWiki MariaDB common package, you can install this if you want to take care yourself of the application server
49 ** ##xwiki-mysql-common## - XWiki MySQL common package, you can install this if you want to take care yourself of the application server
50 ** ##xwiki-pgsql-common## - XWiki PostgreSQL common package, you can install this if you want to take care yourself of the application server
51
52 * {{version since="14.10.19, 15.5.4, 15.9"}} {{/version}}
53 Packages based on a customized Jetty optimized for XWiki
54 ** ##xwiki-xjetty-common## - XWiki Jetty common package, you can install this if you want to take care yourself of the database link
55 ** ##xwiki-xjetty-mariadb## - XWiki Jetty/MariaDB based package
56 ** ##xwiki-xjetty-mysql## - XWiki Jetty/MySQL based package
57 ** ##xwiki-xjetty-pgsql## - XWiki Jetty/PostgreSQL
58
59 * Packages based on the standard Tomcat package
60 ** ##xwiki-tomcat9-common## - XWiki Tomcat 9 common package, you can install this if you want to take care yourself of the database link
61 ** ##xwiki-tomcat10-common## - XWiki Tomcat 10 common package, you can install this if you want to take care yourself of the database link
62 ** ##xwiki-tomcat9-mariadb## - XWiki Tomcat 9/MariaDB based package
63 ** ##xwiki-tomcat10-mariadb## - XWiki Tomcat 10/MariaDB based package
64 ** ##xwiki-tomcat9-mysql## - XWiki Tomcat 9/MySQL based package
65 ** ##xwiki-tomcat10-mysql## - XWiki Tomcat 10/MySQL based package
66 ** ##xwiki-tomcat9-pgsql## - XWiki Tomcat 9/PostgreSQL
67 ** ##xwiki-tomcat10-pgsql## - XWiki Tomcat 10/PostgreSQL
68
69 * Not really XWiki itself but Solr cores needed when you want to use a standalone Solr instance with XWiki
70 ** ##xwiki-solr-all## - An entry point package with dependencies on all the Solr 8 cores required to setup a standalone version compatible with XWiki Standard
71 ** ##xwiki-solr-core## - A pre configured Solr 8 core for the XWiki search feature
72 ** ##xwiki-solr-events## - A pre configured Solr 8 core for the XWiki events/notifications storage
73 ** ##xwiki-solr-ratings## - A pre configured Solr 8 core for the XWiki rating storage
74 ** ##xwiki-solr-extension_index## - A pre configured Solr 8 core for the XWiki extensions index
75 ** ##xwiki-solr9-all## - An entry point package with dependencies on all the Solr 9 cores required to setup a standalone version compatible with XWiki Standard
76 ** ##xwiki-solr9-search## - A pre configured Solr 9 core for the XWiki search feature
77 ** ##xwiki-solr9-events## - A pre configured Solr 9 core for the XWiki events/notifications storage
78 ** ##xwiki-solr9-ratings## - A pre configured Solr 9 core for the XWiki rating storage
79 ** ##xwiki-solr9-extension_index## - A pre configured Solr 9 core for the XWiki extensions index
80
81 Plus legacy packages from older versions of XWiki like ##xwiki-enterprise-*## packages or for unsupported versions of Tomcat.
82
83 {{info}}
84 According to selection, package manager will install all necessary dependencies (application server, database, Java runtime). If you haven't installed these packages before, package manager can ask additional info from you.
85 {{/info}}
86
87 {{warning}}
88 On Ubuntu you will need [[##universe## repository>>https://help.ubuntu.com/community/Repositories/CommandLine]] to install Tomcat packages. It's generally enabled by default.
89 {{/warning}}
90
91 == Complete Installation ==
92
93 {{warning}}
94 Most Debian distributions provide a Tomcat package with a pretty low Memory setting by default (128MB) and this need to be increased for XWiki to fully work. See [[Tomcat Usability section>>||anchor="HTomcatUsability"]] for more details.
95 {{/warning}}
96
97 === Using MariaDB ===
98
99 {{warning}}
100 Note that XWiki requires at least MariaDB 10.2.
101 {{/warning}}
102
103 Xjetty:
104
105 {{code language="bash"}}
106 sudo apt install xwiki-xjetty-mariadb
107 {{/code}}
108
109 Tomcat 10:
110
111 {{code language="bash"}}
112 sudo apt install xwiki-tomcat10-mariadb
113 {{/code}}
114
115 Tomcat 9:
116
117 {{code language="bash"}}
118 sudo apt install xwiki-tomcat9-mariadb
119 {{/code}}
120
121 During the installation you may get some questions from DBconfig, which is in charge of the configuration of XWiki with the MariaDB database. Don't confuse it with the MariaDB root password prompt that asks you for a root password (which is intented for the superuser). If you haven't already installed any MariaDB databases and you are not familiar with it you should let DBconfig handle this.
122
123 Afterwards DBconfig asks you for the MariaDB root password for the "xwiki" MariaDB user. This user will be used to connect to MariaDB from the XWiki application. You should choose the password wisely but you don't have to pay a lot of attention to it after that because DBconfig internally configures XWiki to start up with these credentials.
124
125 {{warning}}
126 The password should not contain any special characters, otherwise XWiki will fail to start. See [[https:~~/~~/jira.xwiki.org/browse/XWIKI-14406>>https://jira.xwiki.org/browse/XWIKI-14406]]
127 {{/warning}}
128
129 The installation ends with the start of the XWiki or Tomcat daemon which is also setup to start automatically from boot.
130
131 === Using MySQL ===
132
133 {{warning}}
134 Note that XWiki requires at least MySQL 5.7. It's not recommended to use this package if your "MySQL" server is in fact MariaDB, see [[the MariaDB section>>||anchor="#HUsingMariaDB"]].
135 {{/warning}}
136
137 Xjetty:
138
139 {{code language="bash"}}
140 sudo apt install xwiki-xjetty-mysql
141 {{/code}}
142
143 Tomcat 10:
144
145 {{code language="bash"}}
146 sudo apt install xwiki-tomcat10-mysql
147 {{/code}}
148
149 Tomcat 9:
150
151 {{code language="bash"}}
152 sudo apt install xwiki-tomcat9-mysql
153 {{/code}}
154
155 Everything else is similar to what is described in the [[the MariaDB section>>||anchor="#HUsingMariaDB"]].
156
157 === Using PostgreSQL ===
158
159 It's as simple as the MySQL installation, you only need to choose the right virtual package.
160
161 Xjetty:
162
163 {{code language="bash"}}
164 sudo apt install xwiki-xjetty-pgsql
165 {{/code}}
166
167 Tomcat 10:
168
169 {{code language="bash"}}
170 sudo apt install xwiki-tomcat10-pgsql
171 {{/code}}
172
173 Tomcat 9:
174
175 {{code language="bash"}}
176 sudo apt install xwiki-tomcat9-pgsql
177 {{/code}}
178
179 Everything else is similar to what is described in the [[the MariaDB section>>||anchor="#HUsingMariaDB"]].
180
181 === Starting up XWiki for the first time... ===
182
183 After you've made sure to update the memory settings (see below), you can now point your favorite browser to the following URL to use your wiki: ##[[http:~~/~~/localhost:8080/xwiki>>http://localhost:8080/xwiki]]##
184
185 {{warning}}
186 Note that your wiki is absolutely empty, like a WAR installation. Distribution Wizard will take care of the rest.
187 {{/warning}}
188
189 == Performance ==
190
191 === XWiki ===
192
193 You can find various [[various generic advices and troubleshooting related to XWiki>>Documentation.AdminGuide.Performances]].
194
195 === Tomcat ===
196
197 You can find [[various generic advices and troubleshooting related to Tomcat>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationTomcat.WebHome]].
198
199 ==== Java Version ====
200
201 Make sure Tomcat is executed with the right [[Java version>>Documentation.AdminGuide.Installation||anchor="HHardwareandSoftwarerequirements"]].
202
203 This is usually indicated in the file ##/etc/default/tomcat9## (or ##/etc/default/tomcat8## for Tomcat 8, etc).
204
205 ==== Memory ====
206
207 The default Tomcat memory setup is too low for XWiki's needs.
208
209 You can change it in the file ##/etc/default/tomcat9## (or ##/etc/default/tomcat8## for Tomcat 8, etc).
210
211 Modify the property ##JAVA_OPTS##. For example:
212
213 {{code language="none"}}
214 JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m"
215 {{/code}}
216
217 You should [[check the Memory settings we recommend>>Documentation.AdminGuide.Performances||anchor="HMemory"]].
218
219 ==== /dev/urandom ====
220
221 In most Debian-based systems the default random implementation is ##/dev/random## which can be very slow. ##/dev/urandom## is much faster and it's fine for XWiki's needs so you should use it when possible:
222
223 * edit ##/etc/default/tomcat9## file and add
224
225 {{code language="bash"}}
226 JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom"
227 {{/code}}
228
229 == Concluding Step ==
230
231 {{include reference="Documentation.AdminGuide.Installation.InstallationConcludingSteps.WebHome"/}}
232
233 == Uninstallation ==
234
235 If you want to remove XWiki from your system, you only have to uninstall the packages you've installed at the beginning of this documentation. For example:
236
237 {{code language="bash"}}
238 sudo apt-get --purge remove xwiki-common
239 {{/code}}
240
241 Attention, these commands do not remove MySQL/PostgreSQL nor Tomcat from your system. To do so, if you don't use these applications for another purpose, you can make some cleaning with
242
243 {{code language="bash"}}
244 sudo apt-get --purge autoremove
245 {{/code}}
246
247 == Troubleshooting ==
248
249 === Log file location ===
250
251 This installation manual should guide you all the way to a fresh and clean XWiki platform. If on the other hand issues may arise, it is important to inspect the XWiki log file for any WARNING messages that may have been brought up. Below you can find the location of this log file for the respective application servers.
252
253 ==== XJetty ====
254
255 {{code language="none"}}
256 /var/log/xwiki/[date].jetty.log
257 {{/code}}
258
259 ==== Tomcat9 ====
260
261 There are several possibilities depending on the distribution:
262
263 {{code language="none"}}
264 /var/log/tomcat9/catalina.out
265 /var/log/tomcat9/Catalina.[date].log
266 {{/code}}
267
268 You can find a generic Troubleshooting section on [[https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/#HTroubleshooting]].
269
270 === No package can be found for Java ===
271
272 XWiki require at least Java 8 since XWiki 8.1 and Java 11 since XWiki 14.0, **OpenJDK 17** (the recommended version) will be automatically installed as dependency on recent distributions.
273
274 If your Debian based distribution does not provide any package for the Java version you need you can try with:
275
276 * Adoptium provides a Debian repository to install Temurin (OpenJDK), see https://adoptium.net/installation/linux/#_deb_installation_on_debian_or_ubuntu
277
278 === Tomcat ===
279
280 See [[Tomcat Installation>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationTomcat||anchor="HTroubleshooting"]] for generic Tomcat related issues.
281
282 === MySQL ===
283
284 See [[MySQL Installation>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationMySQL||anchor="HTroubleshooting"]] for generic MySQL related issues.
285
286 === PostgreSQL ===
287
288 See [[PostgreSQL Installation>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationPostgreSQL||anchor="HTroubleshooting"]] for generic PostgreSQL related issues.
289
290 == Other useful info ==
291
292 === XWiki as root webapp (short URLs) ===
293
294 Note that this section is only the part of Short URL specific to the Debian setup. To fully configure the URL to your liking, see [[full documentation on short URLs>>doc:Documentation.AdminGuide.ShortURLs.WebHome]].
295
296 ==== For Tomcat 9 ====
297
298 {{warning}}
299 When doing it make sure to check after upgrade if all is OK in /etc/tomcat9/Catalina/localhost folder (xwiki.xml might be restored).
300 {{/warning}}
301
302 * Rename file ##/etc/tomcat9/Catalina/localhost/xwiki.xml## into ##/etc/tomcat9/Catalina/localhost/ROOT.xml##
303 * Edit file ##/etc/xwiki/xwiki-tomcat9.xml## and modify ##Context## XML element path from ##/xwiki## to ##/## as in moving from(((
304 {{code language="xml"}}
305 <Context path="/xwiki" docBase="/usr/lib/xwiki"
306 containerSciFilter="org.apache.tomcat.websocket.server.WsSci|org.apache.jasper.servlet.JasperInitializer">
307 {{/code}}
308
309 to
310
311 {{code language="xml"}}
312 <Context path="" docBase="/usr/lib/xwiki"
313 containerSciFilter="org.apache.tomcat.websocket.server.WsSci|org.apache.jasper.servlet.JasperInitializer">
314 {{/code}}
315 )))
316 * Edit file ##/etc/xwiki/xwiki.cfg## and uncomment {{code language="properties"}}xwiki.webapppath={{/code}}
317 * Restart Tomcat 9.
318
319 ==== For Jetty ====
320
321 {{version since="16.7.0"}}
322 You have to modify the ##xjetty-web.xml## file
323
324 The WebAppContext from the xwiki-jetty configuration has to be modified so that Jetty actually serves the XWiki application from the root-path. For this you have to modify the ##/etc/xwiki/xjetty-web.xml## and add the following directive.
325
326 {{code language="xml"}}
327 <Set name="contextPath">/</Set>
328 {{/code}}
329 {{/version}}
330
331 === Integrate with LibreOffice ===
332
333 Install libreoffice with {{code language="none"}}sudo apt-get install libreoffice{{/code}}.
334
335 And setup XWiki to automatically start and access libreoffice in ##/etc/xwiki/xwiki.properties##:
336
337 {{code language="properties"}}
338 openoffice.autoStart=true
339 openoffice.homePath=/usr/lib/libreoffice/
340 {{/code}}
341
342 See [[Office Importer Application>>extensions:Extension.Office Importer Application]] for more details.
343
344 === Standalone Solr setup ===
345
346 Take a look at [[Solr documentation>>https://solr.apache.org/guide/solr/latest/deployment-guide/taking-solr-to-production.html]] to install Solr itself.
347
348 Then you will need to add the XWiki schema configuration: you should install the package ##xwiki-solr-all## for Solr 8 or {{version since="XWiki 16.2.0"}}##xwiki-solr9-all## for Solr 9{{/version}} to automatically register the Solr cores needed by XWiki Standard in the Solr server (provided the standard Solr setup was used).
349
350 === Access a file from XWiki ===
351
352 SystemD is configured to prevent XWiki from accessing an arbitrary file on the file system, even if the system user which runs XWiki would normally be allowed to access it. You can control this in the file ##/etc/systemd/system/tomcat9.service.d/xwiki-tomcat9-systemd.conf## when using ##xwiki-tomcat9-common## and ##/lib/systemd/system/xwiki.service## when using ##xwiki-xjetty-common## and by the default XWiki is allowed and write ##/var/lib/xwiki/data##. Note that once you modified one of those files, you will need to execute ##sudo systemctl daemon-reload## and restart the service.
353
354 == Overview of the important files ==
355
356 Here is a list of a different tree. The point is to help you find useful files easily. This list is showing a few files and directories, to keep it simple and clear. The '->' is used to show a link to another file/directory.
357
358 === XWiki ===
359
360 The configuration: **/etc/xwiki/**
361
362 * hibernate.cfg.xml //Hibernate configuration, helping to configure the database resources//
363 * xwiki.cfg
364 * xwiki.properties
365 * xwiki-tomcat9-systemd.conf // Injected trough ##/etc/systemd/system/tomcat9.service.d/xwiki-tomcat-systemd.conf##// in the tomcat9 service configuration
366 * xwiki-tomcat<version> // The Tomcat integration linked from ##/etc/tomcat<version>/Catalina/localhost##//
367
368 The permanent directory: **/var/lib/xwiki/data**
369
370 The home directory: **/usr/lib/xwiki/**
371
372 * META-INF
373 * resources
374 * skins
375 * templates
376 * WEB-INF
377 ** hibernate.cfg.xml -> /etc/xwiki/hibernate.cfg.xml
378 ** xwiki.cfg -> /etc/xwiki/xwiki.cfg
379 ** xwiki.properties -> /etc/xwiki/xwiki.properties
380
381 === XJetty ===
382
383 **/lib/systemd/system/xwiki.service** is the configuration in charge of controlling the ##xwiki## service, it's also where you can customize its java startup configuration
384
385 === Tomcat ===
386
387 **/etc/tomcat##<version>##/**
388
389 * context.xml
390 * logging.properties
391 * server.xml
392 * tomcat-users.xml
393 * web.xml
394
395 **/etc/default/**
396
397 * tomcat##<version>## //This file helps configuring the Tomcat daemon. Every change needs a restart to be effective//
398
399 **/var/lib/tomcat##<version>##/**
400
401 * common
402 * conf -> /etc/tomcat##<version>##
403 * logs -> ../../log/tomcat##<version>     //Note that starting Debian 10 and Ubuntu 18.04 systemd service log is used//##
404 * server
405 * shared
406 * webapps
407
408 **/var/log/tomcat##<version>##/**
409
410 * catalina.out //First logging file. Check this one if you're experiencing troubles with Tomcat/XWiki.//
411 * localhost.<date>.log // "Container Log file": Start of each filter and failures thereof are listed.//
412
413 === MariaDB/MySQL ===
414
415 **/etc/mysql/**
416
417 * debian.cnf
418 * my.cnf //Database configuration. Max_allowed_packet is the parameter you need to change to improve upload data size.// permitted.
419
420 **/var/lib/mysql/**
421
422 * mysql
423 * xwiki //This is the xwiki database. You may want to backup this directory from time to time.//
424
425 **/var/log/**
426
427 * syslog
428 * mysql
429 ** error.log
430
431 === PostgreSQL ===
432
433 **/etc/postgresql/**
434
435 * ##<version>##
436 ** main
437 *** postgresql.conf
438 *** pg_hba.conf
439
440 **/var/lib/postgresql/##<version>##/main/**
441
442 * base

Get Connected