Wiki source code of Installation

Version 140.1 by Vincent Massol on 2019/12/21

Hide last authors
Jean-Vincent Drean 48.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Ludovic Dubost 28.1 4
Vincent Massol 138.3 5 XWiki is a Java-based wiki and runs on a Servlet Container such as Tomcat, Jetty, JBoss, WebLogic, WebSphere, etc. It also uses a relational database to store its content. It can run on almost any database (MySQL, PostgreSQL, etc) but XWiki and the database need to be setup correctly.
Raffaello Pelagalli 13.1 6
Ecaterina Moraru (Valica) 107.4 7 If you're upgrading an existing XWiki install check the [[Upgrade instructions page>>Documentation.AdminGuide.Upgrade]].
Vincent Massol 31.5 8
Vincent Massol 126.1 9 Pick one of the [[installation methods>>#HInstallationMethods]] to begin installing XWiki.
Vincent Massol 31.5 10
Ecaterina Moraru (Valica) 107.4 11 Once you've finished the installation check the other topics in the [[Admin Guide>>Documentation.AdminGuide.WebHome]] for configuring and [[securing>>Documentation.AdminGuide.Security]] your wiki.
Vincent Massol 31.5 12
Vincent Massol 94.1 13 {{id name="Prerequisites"/}}
Thomas Mortagne 98.1 14
Vincent Massol 94.1 15 = Hardware and Software requirements =
Vincent Massol 75.2 16
Vincent Massol 139.1 17 * Minimal Java versions
Vincent Massol 139.2 18 ** Java 8 for XWiki >= 8.1
Vincent Massol 139.1 19 ** Java 7 for XWiki < 8.1,
Vincent Massol 139.3 20 ** Java 6 for XWiki versions < 6.0
Vincent Massol 139.1 21 * Maximal Java versions
22 ** Java 8 for XWiki < 11.3
23 ** Java 11 for XWiki >= 11.3 {{warning}}We're still testing this. Please let us know if you encounter any issue. Note that we have not started testing Java 12{{/warning}}
Vincent Massol 132.1 24 * A Servlet Container supporting Servlet 3.0.1 (Servlet 2.4 for XWiki versions < 7.0). Check the [[Servlet Containers officially supported by XWiki devs>>dev:Community.ServletContainerSupportStrategy.WebHome]].
25 * A Database and a JDBC 4 Driver for your database (JDBC 3 was required for XWiki versions < 7.0). Check the [[databases offically supported by XWiki devs>>dev:Community.DatabaseSupportStrategy]].
26 * A supported browser to access XWiki. Check the [[browsers offically supported by XWiki devs>>dev:Community.BrowserSupportStrategy]].
Vincent Massol 124.1 27 * Enough memory, check the [[Memory section>>Documentation.AdminGuide.Performances.WebHome#HMemory]] of the [[Performance Guide>>Documentation.AdminGuide.Performances.WebHome]].
Vincent Massol 131.2 28 * Enough [[CPU and RAM>>Documentation.AdminGuide.Performances.WebHome#HSizing]]
Vincent Massol 132.1 29 * Check the [[release notes>>xwiki:ReleaseNotes.WebHome]] for the version you're installing to see what browsers and databases have been tested for it, and to see specific requirements/installation steps. You can also check our [[general support strategy>>dev:Community.SupportStrategy]].
Vincent Massol 140.1 30 * If you're running XWiki on a server without a display, pass the following Java System Property to the JVM running your Servlet Container: ##-Djava.awt.headless=true##.
Vincent Massol 75.2 31
Guillaume Fenollar 69.1 32 = Installation Methods =
33
Vincent Massol 125.1 34 For testing XWiki, we highly recommend one of the following installation method:
35
Vincent Massol 126.1 36 * [[Using XWiki in the cloud>>Hosted.WebHome]]: This is by far the simplest to try XWiki since you don't need to install anything.
Vincent Massol 138.2 37 * [[Using a standalone distribution >>Documentation.AdminGuide.InstallationStandalone]]: Provides a built-in XWiki, with a portable database (HSQLDB) and a lightweight Java container (Jetty). This standalone distribution is not recommended in a production environment (check the [[DB limitations>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationHSQL.WebHome]]). If you need to use it in a production basis, you may look at the other options.
Vincent Massol 125.1 38 * [[Using an official XWiki Docker image>>https://hub.docker.com/_/xwiki/]]: Provides an easy solution to test XWiki, with a configuration very close to a production setup. You can also use this method in production if you're used to putting Docker images in production.
39
40 For production installations, we recommend the following installation method:
41
Ecaterina Moraru (Valica) 107.4 42 * [[Using .deb package (usable for production)>>Documentation.AdminGuide.InstallationViaAPT]]: Provides a .deb package that can be used on a Debian-based operating system. It can be installed with ##dpkg## or ##apt##; installation is thus automated.
Ludovic Dubost 28.1 43
Vincent Massol 125.1 44 Last, you could manually deploy XWiki as a WAR into the Servlet Container of your choice and on the Database of your choice, if the previous methods were not good enough for your needs. Beware that this requires some technical knowledge about Servlet Container and Databses:
45
46 * [[Using .war package (usable for production)>>Documentation.AdminGuide.InstallationWAR]]: Provides a Java application package that has to be installed in a Java container (such as Tomcat). This can be used on almost any operating system.
47
Vincent Massol 129.1 48 {{warning}}
49 Whatever the installation method, you should make sure to [[create the database indexes manually for indexes that are not created automatically>>Documentation.AdminGuide.Performances.Database Administration.WebHome]].
50 {{/warning}}
51
Vincent Massol 93.1 52 = Other Installation Methods =
Vincent Massol 89.1 53
Vincent Massol 93.1 54 This section is about other, non-official ways of installing XWiki that have been contributed by the community.
Vincent Massol 89.1 55
Vincent Massol 93.1 56 {{warning}}
57 Tutorials external to the xwiki.org site have not been validated for correctness by the XWiki Development Team and it's also possible that they are out of date or even not working.
58 {{/warning}}
59
Vincent Massol 131.1 60 * [[How to install XWiki on Debian 9>>https://linuxhostsupport.com/blog/how-to-install-xwiki-on-debian-9/]]
Ecaterina Moraru (Valica) 106.1 61 * [[Ansible playbook for installing XWiki>>https://github.com/rastandy/xwiki-ansible-playbook]]
Vincent Massol 93.1 62 * [[Using yaourt on Arch Linux>>https://github.com/xwiki-contrib/packaging-archlinux]]
63 * [[XWiki On OpenShift (Platform-as-a-Service)>>https://github.com/rkmallik/xwiki-example]]
Vincent Massol 95.2 64 * [[XWiki On Windows>>http://agoncalves.developpez.com/tutoriels/xwiki/creer-un-site-associatif/]] (French)
65 * [[XWiki On Debian 4 (Etch) - Tomcat - PostgreSQL (or MySQL)>>http://www.howtoforge.com/xwiki-tomcat-mysql-debian-etch]] (English)
66 * [[XWiki On Debian 4 (Etch) - Tomcat - PostgreSQL (or MySQL)>>http://www.howtoforge.de/howto/xwiki-on-debian-4-etch-tomcat-mysql]] (German)
67 * [[XWiki On Windows - GlassFish - Oracle>>http://etvc.myxwiki.org/xwiki/bin/view/UNA/XWikiInstalation]] (Russian)
68 * [[XWiki on OpenSUSE - Tomcat - MySQL)>>http://geistreicher-papierkorb.blogspot.com/2011/03/setting-up-xwiki-on-opensuse-with-mysql.html]] (English)
69 * [[XWiki On Archlinux - Tomcat - hsql or MySQL>>https://github.com/xwiki-contrib/packaging-archlinux]] (English)
70 * [[Install XWiki on an Ubuntu 16.04 VPS>>https://www.rosehosting.com/blog/install-xwiki-on-an-ubuntu-16-04-vps/]] (English)
Vincent Massol 95.1 71 * [[Install XWiki using Docker compose>>https://zwindler.fr/wordpress/2016/09/15/installer-xwiki-8-2-1-avec-docker-compose-en-2-lignes-de-commandes]] (French)
Nick Reiner 126.3 72 * [[How to Install XWiki on CentOS 7>>https://thishosting.rocks/how-to-build-your-own-wiki-with-xwiki-on-centos/]] (English)
Thomas Mortagne 133.1 73 * [[XWiki in Windows - PostgreSQL - Tomcat 9 - Waffle>>https://www.youtube.com/watch?v=QLqsvQ5y6cI]] (English, video)
Thomas Mortagne 134.1 74 * [[XWiki 10.9 with LDAP/SSO/MSSQL on Windows>>http://www.ohjeah.net/2018/11/09/xwiki-10-9-with-ldapssomssql-on-windows/]]
Vincent Massol 93.1 75
Vincent Massol 138.1 76 = Accessing your wiki =
77
78 Once you've installed XWiki using one of the methods defined above, you can access it by pointing your web browser to {{code language="none"}}http://localhost:8080/xwiki{{/code}}.
79
Vincent Massol 31.5 80 = Troubleshooting =
Vincent Massol 1.125 81
Manuel Smeria 75.4 82 You can verify some basic settings of your XWiki installation (on Tomcat, MySQL) using the [[Admin Tools application>>extensions:Extension.Admin Tools Application]]. Keep in mind that some of these tools only work in a Linux environment.
Sergiu Dumitriu 74.1 83
Simon Urli 130.1 84 == What to do with an empty XWiki? ==
85
Sergiu Dumitriu 74.1 86 == Running multiple instances of XWiki in the same container ==
87
88 If you get this error:
89
90 {{code}}
91 com.xpn.xwiki.XWikiException: Error number 3 in 0: Could not initialize main XWiki context
92 Wrapped Exception: Failed to get cache factory component
93 ...
94 Caused by:
95 org.infinispan.jmx.JmxDomainConflictException: Domain already registered org.xwiki.infinispan
96 {{/code}}
97
Valdis Vitolins 110.1 98 You need to edit ##WEB-INF/cache/infinispan/config.xml## for each instance of XWiki.
Roman Muntyanu 74.2 99
Valdis Vitolins 111.1 100 1. For Infinispan up till version 6, change the ##jmxDomain## value (found under the ##globalJmxStatistics## tag) to have a unique name, or add ##allowDuplicateDomains="true"## attribute for ##globalJmxStatistics## element.
Valdis Vitolins 110.1 101 1. For Infinispan version 7, add ##<jmx duplicate-domains="true"/>## element in ##<cache-container...## element.
102
103
Adam Shand 119.1 104 == Running XWiki behind a proxy server ==
Thomas Mortagne 75.1 105
Adam Shand 119.1 106 The extension manager relies on remote repositories for finding and fetching available extensions. If your XWiki is installed in a network which requires accessing the internet through a proxy server, most likely searching for extensions will fail and log files will contain ##connection refused## exceptions.
Roman Muntyanu 74.2 107
Adam Shand 119.1 108 In such cases, you can configure XWiki to use the proxy server.
Roman Muntyanu 74.2 109
Manuel Smeria 75.4 110 XWiki uses default Java proxy configuration through Apache httpclient. See the [[Java Networking and Proxies documentation>>http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html]] for more details.
Adam Shand 119.1 111 The main idea is to add a set of proxy-related properties to the system scope.
Roman Muntyanu 74.2 112
Adam Shand 119.1 113 For an installation using Tomcat 6 it could be done in the following way: modify ##/<tomcat-home>/bin/catalina.sh## and added proxies to the ##JAVA_OPTS## variable definition:
Roman Muntyanu 74.2 114
Eduard Moraru 100.3 115 {{code}}
Adam Shand 119.1 116 JAVA_OPTS="$JAVA_OPTS -Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME -Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=7777 -Dhttps.proxyHost=proxy.mycompany.com -Dhttps.proxyPort=7777 -Xmx512m -XX:MaxPermSize=196m $XWIKI_OPTS"
Eduard Moraru 100.3 117 {{/code}}
Vincent Massol 84.1 118
Adam Shand 120.1 119 For an installation of the HSQLDB demo package you could do it by adding something like this to ##/xwiki-platform-distribution-flavor-jetty-hsqldb-x.y/start_xwiki.sh##:
Adam Shand 119.1 120
121 {{code}}
122 XWIKI_OPTS="$XWIKI_OPTS -Dhttp.proxyHost=proxy.mycompany.com -Dhttp.proxyPort=7777 -Dhttps.proxyHost=proxy.mycompany.com -Dhttps.proxyPort=7777"
123 {{/code}}
124
Thomas Mortagne 121.1 125 Note: If your proxy server only allows partial access to the internet you need to make sure that the sites ##store.xwiki.com##, ##extensions.xwiki.org## and ##nexus.xwiki.org## (note that one is .##com## and the others are ##.org##) can be accessed.
Adam Shand 119.1 126
Eduard Moraru 135.1 127 === Debugging proxy configuration issues ===
128
129 If you are having trouble with debugging whether or not the proxy configuration you've just made is properly read by XWiki, you could drop the following groovy script in a new page on your XWiki instance and look for the values of the (proxy) properties you're trying to change:
130
131 {{code language="groovy"}}
132 {{groovy}}
133 println "== Environment Variables =="
134 System.getenv().each { name, value -> println "Name: {{{$name}}} = Value {{{$value}}}" }
135 println ""
136 println "== Java System Properties =="
137 System.getProperties().each { name, value -> println "Name: {{{$name}}} = Value {{{$value}}}" }
138 {{/groovy}}
139 {{/code}}
140
141 Additionally, you could also include this test content that actually tests if your XWiki instance is able to access the Internet (using the "httpbin" service; you can use anything else, including google.com), for both HTTP and HTTPs:
142
143 {{code language="velocity"}}
144 == Test HTTP Access ==
145 Your XWiki server's IP is:
146 {{velocity}}
147 $xwiki.getURLContent("http://httpbin.org/ip")
148 {{/velocity}}
149
150 == Test HTTPS Access ==
151 Your XWiki server's IP is:
152 {{velocity}}
153 $xwiki.getURLContent("https://httpbin.org/ip")
154 {{/velocity}}
155 {{/code}}
156
Vincent Massol 84.1 157 == Unsupported major.minor version 51.0 ==
158
159 This is because starting with version 6.0, XWiki requires Java 7 and you're using Java 6. You need to upgrade your Java version.
160
Thomas Mortagne 116.1 161 {{include reference="Documentation.AdminGuide.Installation.InstallationConcludingSteps.WebHome" section="HInstallingwithoutinternetconnection"/}}
Vincent Massol 85.1 162
Thomas Mortagne 98.1 163 == Getting an error about SSL certificate ==
164
Vincent Massol 99.4 165 If you get an error in the log telling you that it fail to access some some https website it usually means you have a too old version of Java 8 (older that update 101) and you should upgrade it (does not need to be upgraded to next major version of Java, just make sure you have at least Java 8 update 101).
Thomas Mortagne 98.1 166
167 {{code language="none"}}
168 2017-03-14 20:40:17,494 [http://dwswiki10:8080/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=XWiki.AddExtensions] ERROR aultExtensionRepositoryManager - Failed to search on repository [store.xwiki.com:xwiki:https://store.xwiki.com/xwiki/rest] with query [org.xwiki.extension.repository.search.ExtensionQuery@78b5e254]. Ignore and go to next repository.
169 org.xwiki.extension.repository.search.SearchException: Failed to search extensions based on pattern []
170 at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.search(XWikiExtensionRepository.java:434)
Thomas Mortagne 99.1 171 ...
Thomas Mortagne 98.1 172 Caused by: java.io.IOException: Failed to request [https://store.xwiki.com/xwiki/rest/repository/search?start=0&number=20&q=]
173 at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.getRESTResource(XWikiExtensionRepository.java:246)
Thomas Mortagne 99.1 174 ...
Thomas Mortagne 98.1 175 Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
176 at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
Thomas Mortagne 99.1 177 ...
Thomas Mortagne 98.1 178 Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
179 at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
Thomas Mortagne 99.1 180 ...
Thomas Mortagne 98.1 181 Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
182 at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:145)
Thomas Mortagne 99.1 183 ...
Thomas Mortagne 98.1 184 {{/code}}
Eduard Moraru 100.2 185
186 == "File path too long" on Windows when unzipping ==
187
Eduard Moraru 100.3 188 The Windows Operating System imposes a [[file path limit to around 260 characters>>https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath]]. XWiki's zip file can, in some cases, reach paths as long a 182 characters, or even longer. To avoid such errors you could do one of the following:
Thomas Mortagne 101.1 189
Eduard Moraru 100.2 190 * Install in a folder that is as close to the root of the drive as possible and uses a small name, e.g. ##C:\xwiki##
191 * Install XWiki using the [[cygwin>>https://www.cygwin.com/]] environment that overcomes this limitation
192 * Starting with Windows 10, you can set or create the ##EnableLongPaths## with a value of ##1## in the in the ##HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem## Windows Registry in order to activate support for long paths. More details and step-by-step instructions are available in various online tutorials such as [[this one>>https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/]].
Vincent Massol 137.2 193 * As Windows Unarchiver cannot unzip files with long paths, [[7-Zip>>https://www.7-zip.org/]]can be used instead.

Get Connected