Beginners question: how do I install XWiki (WAR or DEB, Oracle RDBMS)

Hi all,
maybe it’s a noob question for most of you…
But all I’m trying to do is to install XWiki on an existing Debian (still Wheezy, sorry) server and to point it to an existing Oracle database.

First steps I tried:
Using a DEB archive I successfully installed Tomcat7 and “xwiki-tomcat7-common”, but at the point to edit “hibernate.cfg.xml” to point to my Oracle DB, I noticed there is no hibernate.cfg.xml at all!

So I tried to switch back and go the long way on my own: manual installation if the WAR archive.
May anyone point me to the actual installation step on the WAR Installation Guide?
According that guide I first have to download the WAR and check the requirements - and… nothing more?

Can please anyone explain what to do with a WAR and maybe help me find the missing hibernate.cfg.xml?
Do I need to install any MySQL or Postgres first? Can I create the file from scratch, as there already is a symbolic link “/usr/lib/xwiki/WEB-INF/hibernate.cfg.xml → /etc/xwiki/hibernate.cfg.xml”?

Thanks in advance,
Sven

Hi there, I had similar trouble when starting out as well. Will try my best to show the steps I use when creating from scratch.

  1. Install a servlet ( I used Tomcat so that’s what I will use as an example here): http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/

  2. The Method of installing the WAR is explained in the Tomcat installation guide in detail. But to clarify, you simply EXTRACT the WAR file and paste the extracted folder into the ones listed in the installation guide.

  3. Install MySQL using the steps given; http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationMySQL/

Then create a user and database using the following command; CREATE DATABASE xwiki CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON xwiki.* TO ‘xwiki’@‘localhost’ IDENTIFIED BY ‘xwiki’;
From there, set a password on your Xwiki user.

Am sure I have missed some details but those 2 links should be able to cover most of the questions that may arise. If you have any more questions when you get to this stage, please ask.

Thanks Syn!
I somehow missed the fact, that WAR is a simple archive which I might extract everywhere. So I only took the missing hibernate.cfg.xml from there, corrected it to use my Oracle Instant client and it worked.
For some reason I had to place the ojdbc6.jar into /usr/share/tomcat7/lib/ rather than /usr/lib/xwiki/WEB-INF/lib/ which gave me the well known “NullPointerException at HqlSqlWalker”…

For everyone that faces the same problem, here are my steps to get it running with Oracle instant client:

  • install Java 8 and configure APT sources up to “Second Step : Complete installation” in the Installation using Debian (.DEB) packages
  • install Oracle Instant Client (actually extract it to /opt/oracle/instantclient)
  • create the DB user as outlined in Oracle Installation
  • issue ‘sudo apt-get install xwiki-tomcat7-common’ (or choose tomcat8 if available for your distribution)
  • you may run into the problem, that Tomcat 7 does not find the Java 8 home, so explicitly set JAVA_HOME=/usr/lib/jvm/java-8-oracle in the config file /etc/default/tomcat7
  • increase Tomcat memory in this same file as described in the “Tomcat Usability Section”
  • create the file /usr/share/tomcat7/bin/setenv.sh and set it executable with the following content:

#!/bin/sh
export PATH=${PATH}:/opt/oracle/instantclient/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/oracle/instantclient/

  • (re-)start Tomcat: ‘sudo /etc/init.d/tomcat7 restart
  • if the installation aborted on the first attempt, be sure to complete if with ‘sudo apt-get install -f
  • finally extract the missing hibernate.cfg.xml from the currect WAR archive to /etc/xwiki/ and configure the Oracle section. I used the simple SID to name the database source rather than the global full name:

<property name=“connection.url”>jdbc:oracle:thin:@[ServerIP]:1521:[MySID]</property>

Now I can go on finishing the installation wizard by accessing:
http://[TomcatServerURL]:8080/xwiki/

Thanks again,
Sven

Thanks @Syn for the detailed explanations!

I just wanted to note that this is the manual and probably the most complicated way of installing XWiki (and also to upgrade it later on). The simplest method is this one (if you can use it): http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/

That’s actually what @Syn did but we don’t provide any final package for Oracle so what is detailed in his message is the Oracle part.