Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
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 = APT Configuration =
10
11 First, you have to configure your package manager in order to use XWiki's repository. This can be done simply, using this command:
12
13 {{code language="bash"}}
14 sudo wget https://maven.xwiki.org/xwiki-keyring.gpg -P /usr/share/keyrings/
15 sudo wget "https://maven.xwiki.org/stable/xwiki-stable.list" -P /etc/apt/sources.list.d/
16 {{/code}}
17
18 {{info}}
19 Note that there is several repositories you can choose (as alternatives to the stable one you have in the previous example):
20
21 * [[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)
22 * [[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)
23 * [[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]]
24 {{/info}}
25
26 Now you can update the packages database to read the data from this repository.
27
28 {{code language="bash"}}
29 sudo apt-get update
30 {{/code}}
31
32 Now you can make a little search to see what this repo offers.
33
34 {{code language="bash"}}
35 apt-cache search xwiki
36 {{/code}}
37
38 It shows the following packages (the exact list depends on the version the repository contains):
39
40 * xwiki-common - XWiki, you can install this if you want to take care yourself of the database and application server
41 * xwiki-mariadb-common - XWiki MariaDB common package, you can install this if you want to take care yourself of the application server
42 * xwiki-mysql-common - XWiki MySQL common package, you can install this if you want to take care yourself of the application server
43 * xwiki-pgsql-common - XWiki PostgreSQL common package, you can install this if you want to take care yourself of the application server
44 * xwiki-tomcat8-common - XWiki Tomcat 8 common package, you can install this if you want to take care yourself of the database link
45 * xwiki-tomcat9-common - XWiki Tomcat 9 common package, you can install this if you want to take care yourself of the database link
46 * xwiki-tomcat8-mariadb - XWiki Tomcat 8/MariaDB based package
47 * xwiki-tomcat9-mariadb - XWiki Tomcat 9/MariaDB based package
48 * xwiki-tomcat8-mysql - XWiki Tomcat 8/MySQL based package
49 * xwiki-tomcat9-mysql - XWiki Tomcat 9/MySQL based package
50 * xwiki-tomcat8-pgsql - XWiki Tomcat 8/PostgreSQL
51 * xwiki-tomcat9-pgsql - XWiki Tomcat 9/PostgreSQL
52 * xwiki-solr-all - An entry point package which a dependency on all the solr core required to setup a standalone version compatible with XWiki Standard
53 * xwiki-solr-core - A pre configured Solr core for the XWiki search feature
54 * xwiki-solr-events - A pre configured Solr core for the XWiki events/notifications storage
55 * xwiki-solr-ratings - A pre configured Solr core for the XWiki rating storage
56
57 Plus legacy packages from older versions of XWiki like xwiki-enterprise-* packages or for unsupported versions of Tomcat.
58
59 {{error}}
60 xwiki-enterprise-* packages were deprecated as of 9.4. Installations requiring those packages will appear to have stopped updating at version 9.4. Install the corresponding xwiki-* package to update to the latest version. (For example, if you were relying on the ##xwiki-enterprise-tomcat8-mysql## package, you will now need to install the ##xwiki-tomcat8-mysql## package.)
61 {{/error}}
62
63 {{info}}
64 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.
65 {{/info}}
66
67 {{warning}}
68 On Ubuntu you will need [[##universe## repository>>https://help.ubuntu.com/community/Repositories/CommandLine]] to install Tomcat packages. It's generally enabled by default.
69 {{/warning}}
70
71 = Complete Installation =
72
73 {{warning}}
74 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.
75 {{/warning}}
76
77 == Using MariaDB ==
78
79 {{warning}}
80 Note that XWiki require at least MariaDB 10.2. If your Debian distribution provide an older version (like Debian Stretch/9) you can use the one from the repositories provided by the MariaDB project to get a more recent version on https://downloads.mariadb.org/mariadb/repositories/.
81 {{/warning}}
82
83 The following will install everything you need to run XWiki with MariaDB and Tomcat 9:
84
85 {{code language="bash"}}
86 sudo apt-get install xwiki-tomcat9-mariadb
87 {{/code}}
88
89 This package depends on xwiki-common, xwiki-tomcat9-common, xwiki-mariadb-common, mariadb-server and tomcat9. You might have to select a different version of Tomcat depending on what's available in your system repository.
90
91 During the installation, you may have some questions from dbconfig, in charge of the configuration of the database. Don't confuse it with the MariaDB root password prompt, which beg you to put a password for the superuser.
92 DBconfig prompt is about the configuration of xwiki and mariadb. If you haven't any mariadb already installed and you aren't familiar with it, you should let dbconfig handle this.
93
94 DBconfig is then asking you for the mariadb root password (you may have entered before). Then, you can choose the password for the "xwiki" mariadb user. This user will be used to connect from XWiki application. Choose it wisely, but you don't have to pay a lot of attention to it, because after that, dbconfig is configuring XWiki automatically with these credentials.
95
96 The installation now ends, with the automatic start of tomcat daemon ("Starting Tomcat servlet engine tomcat9 [OK]").
97
98 {{warning}}
99 Note that your wiki is absolutely empty, like a WAR installation. Distribution Wizard will take care of the rest.
100 {{/warning}}
101
102 == Using MySQL ==
103
104 {{warning}}
105 Note that XWiki require at least MySQL 5.7. This package also works with MariaDB (in which case you need at least MariaDB 10.2).
106 {{/warning}}
107
108 The following will install everything you need to run XWiki with MySQL and Tomcat 9:
109
110 {{code language="bash"}}
111 sudo apt-get install xwiki-tomcat9-mysql
112 {{/code}}
113
114 This package depends on xwiki-common, xwiki-tomcat9-common, xwiki-mysql-common, mysql-server and tomcat9. You might have to select a different version of Tomcat depending on what's available in your system repository.
115
116 During the installation, you may have some questions from dbconfig, in charge of the configuration of the database. Don't confuse it with the MySQL root password prompt, which beg you to put a password for the superuser.
117 DBconfig prompt is about the configuration of xwiki and mysql. If you haven't any mysql already installed and you aren't familiar with it, you should let dbconfig handle this.
118
119 DBconfig is then asking you for the mysql root password (you may have entered before). Then, you can choose the password for the "xwiki" mysql user. This user will be used to connect from XWiki application. Choose it wisely, but you don't have to pay a lot of attention to it, because after that, dbconfig is configuring XWiki automatically with these credentials.
120
121 The installation now ends, with the automatic start of tomcat daemon ("Starting Tomcat servlet engine tomcat9 [OK]").
122
123 {{warning}}
124 Note that your wiki is absolutely empty, like a WAR installation. Distribution Wizard will take care of the rest.
125 {{/warning}}
126
127 == Using PostgreSQL ==
128
129 It's as simple as the MySQL installation, you only need to choose the right virtual package.
130
131 {{code language="bash"}}
132 sudo apt-get install xwiki-tomcat9-pgsql
133 {{/code}}
134
135 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##
136
137 PostgreSQL is slightly different than MySQL in the handling of databases and in the manual configuration, but everything should work on the first try.
138
139 == Security settings ==
140
141 1. (((
142 Open ##/etc/xwiki/xwiki.cfg## file and change lines:
143
144 {{code language="none"}}
145 ...
146 #-# Cookie encryption keys. You SHOULD replace these values with any random string,
147 #-# as long as the length is the same.
148 xwiki.authentication.validationKey=your1stkeyhere
149 xwiki.authentication.encryptionKey=your2ndkeyhere
150 ...
151 {{/code}}
152 )))
153 1. (((
154 If you need, add password to the built-in superadmin account, by changing line:
155
156 {{code language="none"}}
157 ...
158 #-# Enable to allow superadmin. It is disabled by default as this could be a
159 #-# security breach if it were set and you forgot about it. Should only be enabled
160 #-# for recovering the Wiki when the rights are completely messed.
161 xwiki.superadminpassword=yourpassword
162 ...
163 {{/code}}
164 )))
165
166 == Tomcat Usability ==
167
168 You can find [[various generic advices and troubleshooting related to Tomcat>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationTomcat.WebHome]].
169
170 === Java Version ===
171
172 Make sure Tomcat is executed with the right [[Java version>>platform:AdminGuide.Installation||anchor="HHardwareandSoftwarerequirements"]].
173
174 This is usually indicated in the file ##/etc/default/tomcat9## (or ##/etc/default/tomcat8## for Tomcat 8, etc).
175
176 === Memory ===
177
178 The default Tomcat memory setup is too low for XWiki's needs.
179
180 You can change it in the file ##/etc/default/tomcat9## (or ##/etc/default/tomcat8## for Tomcat 8, etc).
181
182 Modify the property ##JAVA_OPTS##. For example:
183
184 {{code language="none"}}
185 JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m"
186 {{/code}}
187
188 You should [[check the Memory settings we recommend>>Documentation.AdminGuide.Performances||anchor="HMemory"]].
189
190 === /dev/urandom ===
191
192 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:
193
194 * edit ##/etc/default/tomcat9## file and add
195
196 {{code language="bash"}}
197 JAVA_OPTS="${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom"
198 {{/code}}
199
200 = Concluding Step =
201
202 {{include reference="Documentation.AdminGuide.Installation.InstallationConcludingSteps.WebHome"/}}
203
204 = Uninstallation =
205
206 If you want to remove XWiki from your system, you only have to uninstall the package you've installed at the beginning of this documentation. For example:
207
208 {{code language="bash"}}
209 sudo apt-get --purge remove xwiki-common
210 {{/code}}
211
212 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
213
214 {{code language="bash"}}
215 sudo apt-get --purge autoremove
216 {{/code}}
217
218 = Troubleshooting =
219
220 You can find a generic Troubleshooting section on [[https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/#HTroubleshooting]].
221
222 == No package can be found for Java ==
223
224 XWiki require at least Java 8 since XWiki 8.1 and Java 11 since XWiki 14.0, **OpenJDK 11** (the recommended version) will be automatically installed as dependency on recent distributions.
225
226 If you Debian distribution does not provide any package for the Java version you need to can try with:
227
228 * AdoptOpenJDK provide a Debian repository to install OpenJDK, see https://adoptopenjdk.net/installation.html#linux-pkg
229
230 == I get an error when using the chart macro ==
231
232 The chart macro doesn't appear to be working with a clean install with the openjdk 8 Debian package (openjdk 11, which is the recommended version, does not seems to be affected). It gives an error:
233
234 > Failed to execute the [chart] macro. Cause: [Could not initialize class org.jfree.chart.JFreeChart].
235
236 In some Debian/Ubuntu versions a broken accessibility option is enabled by default on Java 8 and it's what is causing this error. See https://jira.xwiki.org/browse/XWIKI-16993 and https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/935296 for more details.
237
238 To disable it go to ##/etc/java-8-openjdk/accessibility.properties## (or another path depending on your version of Java) and comment the line:
239
240 {{code language="properties"}}
241 # assistive_technologies=org.GNOME.Accessibility.AtkWrapper
242 {{/code}}
243
244 == Tomcat ==
245
246 See [[Tomcat Installation>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationTomcat||anchor="HTroubleshooting"]] for generic Tomcat related issues.
247
248 == MySQL ==
249
250 See [[MySQL Installation>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationMySQL||anchor="HTroubleshooting"]] for generic MySQL related issues.
251
252 == PostgreSQL ==
253
254 See [[PostgreSQL Installation>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationPostgreSQL||anchor="HTroubleshooting"]] for generic PostgreSQL related issues.
255
256 = Other useful info =
257
258 == XWiki as root webapp (short URLs) ==
259
260 Note that this section is only the part of Short URL specific to the Debian setup, for the rest you will have to look at [[the generic documentation>>doc:Documentation.AdminGuide.ShortURLs.WebHome]].
261
262 === For Tomcat 9 ===
263
264 {{warning}}
265 When doing it make sure to check after upgrade if all is OK in /etc/tomcat9/Catalina/localhost folder (xwiki.xml might be restored).
266 {{/warning}}
267
268 * Rename file ##/etc/tomcat9/Catalina/localhost/xwiki.xml## into ##/etc/tomcat9/Catalina/localhost/ROOT.xml##
269 * Edit file ##/etc/xwiki/xwiki-tomcat9.xml## and modify ##Context## XML element path from ##/xwiki## to ##/## as in moving from(((
270 {{code language="xml"}}
271 <Context path="/xwiki" docBase="/usr/lib/xwiki"
272 containerSciFilter="org.apache.tomcat.websocket.server.WsSci|org.apache.jasper.servlet.JasperInitializer">
273 {{/code}}
274
275 to
276
277 {{code language="xml"}}
278 <Context path="/" docBase="/usr/lib/xwiki"
279 containerSciFilter="org.apache.tomcat.websocket.server.WsSci|org.apache.jasper.servlet.JasperInitializer">
280 {{/code}}
281 )))
282 * Edit file ##/etc/xwiki/xwiki.cfg## and uncomment {{code language="properties"}}xwiki.webapppath={{/code}}
283
284 == Integrate with LibreOffice ==
285
286 Install libreoffice with {{code language="none"}}sudo apt-get install libreoffice{{/code}}.
287
288 And setup XWiki to automatically start and access libreoffice in ##/etc/xwiki/xwiki.properties##:
289
290 {{code language="properties"}}
291 openoffice.autoStart=true
292 openoffice.homePath=/usr/lib/libreoffice/
293 {{/code}}
294
295 See [[Office Importer Application>>extensions:Extension.Office Importer Application]] for more details.
296
297 == Standalone Solr setup ==
298
299 Take a look at [[Solr documentation>>https://solr.apache.org/guide/8_8/taking-solr-to-production.html]] to install it.
300
301 Then you will need to add the XWiki schema configuration: you should install the package ##xwiki-solr-all## to automatically register the Solr cores needed by XWiki Standard in the Solr server (provided the standard setup was used).
302
303 = Overview of the important files =
304
305 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.
306
307 == XWiki ==
308
309 The configuration: **/etc/xwiki/**
310
311 * hibernate.cfg.xml //Hibernate configuration, helping to configure the database resources//
312 * xwiki.cfg
313 * xwiki.properties
314 * xwiki-tomcat9-systemd.conf // Injected trough ##/etc/systemd/system/tomcat9.service.d/xwiki-tomcat-systemd.conf##// in the tomcat9 service configuration
315 * xwiki-tomcat<version> // The Tomcat integration linked from ##/etc/tomcat<version>/Catalina/localhost##//
316
317 The permanent directory: **/var/lib/xwiki/data**
318
319 The home directory: **/usr/lib/xwiki/**
320
321 * META-INF
322 * resources
323 * skins
324 * templates
325 * WEB-INF
326 ** hibernate.cfg.xml -> /etc/xwiki/hibernate.cfg.xml
327 ** xwiki.cfg -> /etc/xwiki/xwiki.cfg
328 ** xwiki.properties -> /etc/xwiki/xwiki.properties
329
330 == Tomcat ==
331
332 **/etc/tomcat##<version>##/**
333
334 * context.xml
335 * logging.properties
336 * server.xml
337 * tomcat-users.xml
338 * web.xml
339
340 **/etc/default/**
341
342 * tomcat##<version>## //This file helps configuring the Tomcat daemon. Every change needs a restart to be effective//
343
344 **/var/lib/tomcat##<version>##/**
345
346 * common
347 * conf -> /etc/tomcat##<version>##
348 * logs -> ../../log/tomcat##<version>     //Note that starting Debian 10 and Ubuntu 18.04 systemd service log is used//##
349 * server
350 * shared
351 * webapps
352
353 **/var/log/tomcat##<version>##/**
354
355 * catalina.out //First logging file. Check this one if you're experiencing troubles with Tomcat/XWiki.//
356 * localhost.<date>.log // "Container Log file": Start of each filter and failures thereof are listed.//
357
358 == MySQL ==
359
360 **/etc/mysql/**
361
362 * debian.cnf
363 * my.cnf //Database configuration. Max_allowed_packet is the parameter you need to change to improve upload data size.// permitted.
364
365 **/var/lib/mysql/**
366
367 * mysql
368 * xwiki //This is the xwiki database. You may want to backup this directory from time to time.//
369
370 **/var/log/**
371
372 * syslog
373 * mysql
374 ** error.log
375
376 == PostgreSQL ==
377
378 **/etc/postgresql/**
379
380 * ##<version>##
381 ** main
382 *** postgresql.conf
383 *** pg_hba.conf
384
385 **/var/lib/postgresql/##<version>##/main/**
386
387 * base

Get Connected