Version 7.7 by Vincent Massol on 2013/11/05

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 You'll need to perform 2 mandatory steps:
6
7 * Install and configure a Servlet Container
8 * Install and configure a relational database
9
10 But first, you'll need to [[download>>enterprise:Main.Download]] the .war version of XWiki and check the [[System Requirements>>AdminGuide.Installation#HPrerequisites]].
11
12 = Install and configure a Servlet Container =
13
14 XWiki will work with any Servlet Container (provided it's properly configured obviously). We're only listing instructions for a few containers but you can adapt these instructions for your favorite container.
15
16 * [[Tomcat installation>>AdminGuide.InstallationTomcat]]
17 * [[Jetty installation>>AdminGuide.InstallationJetty]]
18 * [[GlassFish installation>>AdminGuide.InstallationGlassFish]]
19 * [[WebSphere installation>>AdminGuide.InstallationWebSphere]]
20 * [[JBoss Installation>>AdminGuide.InstallationJBoss]]
21 * [[Oracle OC4J Installation>>AdminGuide.InstallationOC4J]]
22 * [[Apache Geronimo>>AdminGuide.InstallationGeronimo]]
23
24 Some containers have the Java Security Manager turned on. In this case, XWiki needs to be granted some permissions. Below there's a sample policy file if you want to run your container with the Security Manager active. Depending on the version of XWiki Enterprise that you use and on the plugins/extensions that you use the permissions might need to be adjusted to your needs:
25
26 {{code language="none"}}
27 grant codeBase "file:<full-path-here>/webapps/xwiki/WEB-INF/lib/-" {
28 permission java.util.PropertyPermission "file.encoding", "read";
29 // Needed by Hibernate -> antlr
30 permission java.util.PropertyPermission "ANTLR_DO_NOT_EXIT", "read";
31 permission java.util.PropertyPermission "ANTLR_USE_DIRECT_CLASS_LOADING", "read";
32 // Needed by Hibernate and others
33 permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
34 permission java.lang.RuntimePermission "createClassLoader";
35 permission java.lang.RuntimePermission "setContextClassLoader";
36 // Needed by commons-logging
37 permission java.util.PropertyPermission "org.apache.commons.logging.LogFactory.HashtableImpl", "read";
38 // Needed for connecting to the database
39 permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve";
40 // Needed by the scheduler plugin -> quartz, but works without (maybe except scheduling? should be checked)
41 // permission java.util.PropertyPermission "org.quartz.properties", "read";
42
43 //Allow file storage directory reading - for directory and everything underneath
44 //This is dependent on the setting of environment.permanentDirectory in xwiki.properties
45 permission java.io.FilePermission "${catalina.home}${file.separator}xwikidata${file.separator}", "read,write,delete";
46 permission java.io.FilePermission "${catalina.home}${file.separator}xwikidata${file.separator}-", "read,write,delete";
47 //Allow file storage directory reading - temporary directory and everything underneath
48 //This is dependent on the setting of environment.temporaryDirectory in xwiki.properties.
49 permission java.io.FilePermission "${catalina.home}${file.separator}temp${file.separator}", "read,write,delete";
50 permission java.io.FilePermission "${catalina.home}${file.separator}temp${file.separator}-", "read,write,delete";
51 };
52 {{/code}}
53
54 You're now ready to install and configure your relational database.
55
56 = Install and configure a Relational Database =
57
58 XWiki can work with a lot of relational databases. We're only listing those that we have tested it on.
59
60 The general strategy is the following:
61
62 * Install your favorite RDBMS
63 * Create a ##xwiki## database
64 * Create a user with all privileges on that database
65 * Copy your RDBMS Java drivers to the XWiki webapp's ##WEB-INF/lib## directory
66 * Configure XWiki to use the created database. This involves modifying the ##WEB-INF/hibernate.cfg.xml## file as is described in the tutorials for each database below.
67
68 Note that a more scalable and J2EE-conformant tactic is to use the Servlet container to manage your data source. You modify the web app as little as possible... hopefully one day XWiki will allow you to override ##hibernate.cfg.xml## without needing to change the app itself.
69 ** Do not add your JDBC library to the web app. Install it to the container classpath instead, like to ##$CATALINA_HOME/common/lib##.
70 ** Do not set user, url, etc., nor connection.provider_class in ##hibernate.cfg.xml##. The critical settings are ##connection.datasource## (with JNDI name like ##java:/comp/env/jdbc/XWikiDS##) and the dialect class for your DB vendor. Do not comment out <mapping resource="..."/> elements, hibernate needs them. (You should leave the provider_class unset, since Xwiki's implementation doesn't handle container-managed data sources).
71 ** Manage all database access settings using your container facilities, for example Tomcat admin webapp or server.xml + APPNAME.xml. Uncommenting the <resource-ref> element inside ##WEB-INF/web.xml## that matches the above JNDI name and looks like <res-ref-name>jdbc/XWikiDS</res-ref-name> could be a good idea.
72
73 Install and configure the database you wish to use:
74
75 * [[HSQL Installation>>AdminGuide.InstallationHSQL]]
76 * [[MySQL Installation>>AdminGuide.InstallationMySQL]]
77 * [[PostgreSQL Installation>>AdminGuide.InstallationPostgreSQL]]
78 * [[Oracle Installation>>AdminGuide.InstallationOracle]]
79 * [[DB2 Installation>>AdminGuide.InstallationDB2]]
80 * [[Derby Installation>>AdminGuide.InstallationDerby]]
81 * [[Microsoft SQL Server Installation>>AdminGuide.InstallationMSSQL]]
82 * [[H2 Installation>>AdminGuide.InstallationH2]]
83
84 {{info}}
85 If your database is empty this will result in a minimal empty wiki installation. You may want to use the [[Import/Export tool>>AdminGuide.ImportExport]] to import some pages in your wiki. We recommend that you import the [[provided default XAR>>xwiki:Main.Download]]. If you're upgrading from an existing installation your database should already contain the pages you had before.
86 {{/info}}
87
88 = Concluding Step =
89
90 At this stage you have finished configuration XWiki. If you start your database and container and point your browser to ##http:~//localhost:8080/xwiki/## you'll have a working, albeit minimal, wiki (without any page loaded). The next step is either to create new pages by hand or import the default Wiki that we are providing as a [[XAR file>>xwiki:Main.Download]], by using the [[Import feature>>AdminGuide.ImportExport]].
91
92 = Installing the Default Wiki XAR =
93
94 The default wiki is a fully configured wiki that you can use as a starting point for creating your own wiki content. It provides the following:
95
96 * A [[Blog>>extensions:Extension.Blog Application]]
97 * A [[Dashboard>>extensions:Extension.Dashboard Application]]
98 * A [[Panels Application>>extensions:Extension.Panels Application]]
99 * [[Search>>extensions:Extension.Search Application]]
100 * [[Administration features>>extensions:Extension.Administration Application]] (Access rights, Group and users management, etc)
101 * ... and much more
102
103 **It comes configured with an "Admin" user (password is "admin" in lowercase). You'll need that username/password to log in once you've imported the default wiki.**
104
105 To install the XAR, use the [[Import/Export tool>>AdminGuide.ImportExport]].
106
107 {{warning}}
108 If you're upgrading an existing wiki be careful that the XAR import operation will replace the content of the existing pages of your wiki with the content of the XAR (New pages that you have created will not be modified). As a consequence it's critical that you [[perform a backup>>platform:AdminGuide.Backup]] first and read the upgrade nodes bellow carefully.
109 {{/warning}}

Get Connected