Difference between revisions of "XWiki"

From ArchWiki
Jump to: navigation, search
(recategorize to avoid redirect after the old category has been renamed (https://github.com/lahwaacz/wiki-scripts/blob/master/recategorize-over-redirect.py))
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Web Server]]
+
[[Category:Web server]]
 
XWiki is an open-source enterprise-ready wiki written in Java, with a focus on extensibility.  For more information, see the [[Wikipedia:XWiki|Wikipedia article]], and the [http://www.xwiki.org XWiki Homepage].
 
XWiki is an open-source enterprise-ready wiki written in Java, with a focus on extensibility.  For more information, see the [[Wikipedia:XWiki|Wikipedia article]], and the [http://www.xwiki.org XWiki Homepage].
  
Line 6: Line 6:
 
==Installation==
 
==Installation==
  
Feel free to follow along on the [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation XWiki Installation Guide].  These instructions assume you will be using [[Tomcat]] and [[PostgreSQL]].  It shouldn't be too difficult to apply these guidelines to other combinations.
+
Feel free to follow along on the [http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation XWiki Installation Guide].  These instructions assume you will be using [[Tomcat]] and [[PostgreSQL]].  It should not be too difficult to apply these guidelines to other combinations.
  
 
* Install [[PostgreSQL]].
 
* Install [[PostgreSQL]].
* For easier PostgreSQL administration, install [[phppgadmin|phpPgAdmin]].
+
* For easier PostgreSQL administration, install [[phpPgAdmin]].
* Install [[Tomcat|Tomcat 7]].  (Don't forget {{ic|tomcat-native}}.)
+
* Install [[Tomcat|Tomcat 7]].  (Do not forget {{ic|tomcat-native}}.)
 
+
{{Note|Tomcat 7 is set up to expect {{ic|jre7-openjdk}} by default.  If you prefer to use {{ic|openjdk6}}, you'll need to alter the {{ic|TOMCAT_JAVA_HOME}} variable in {{ic|/etc/conf.d/tomcat7}}, or Tomcat will not start.}}
+
 
+
 
* Download the XWiki WAR file.
 
* Download the XWiki WAR file.
 
* Rename the WAR file to {{ic|xwiki}}.
 
* Rename the WAR file to {{ic|xwiki}}.
Line 33: Line 30:
 
*** Modify the database name (in {{ic|connection.url}}), username, and password as desired.
 
*** Modify the database name (in {{ic|connection.url}}), username, and password as desired.
 
* Create a role and database in PostgreSQL to match the hibernate configuration.
 
* Create a role and database in PostgreSQL to match the hibernate configuration.
* Install [https://aur.archlinux.org/packages.php?ID=14954 postgresql-jdbc] from the [[Arch User Repository]].
+
* Install {{AUR|postgresql-jdbc}} from the [[Arch User Repository]].
 
* As root:
 
* As root:
 
{{bc|
 
{{bc|

Latest revision as of 17:13, 26 July 2015

XWiki is an open-source enterprise-ready wiki written in Java, with a focus on extensibility. For more information, see the Wikipedia article, and the XWiki Homepage.

You may also be interested in Foswiki, which caters to similar needs, but is written in Perl.

Installation

Feel free to follow along on the XWiki Installation Guide. These instructions assume you will be using Tomcat and PostgreSQL. It should not be too difficult to apply these guidelines to other combinations.

  • Install PostgreSQL.
  • For easier PostgreSQL administration, install phpPgAdmin.
  • Install Tomcat 7. (Do not forget tomcat-native.)
  • Download the XWiki WAR file.
  • Rename the WAR file to xwiki.
  • Move the WAR file into the /var/lib/tomcat7/webapps directory.
  • Tomcat should automatically extract the WAR file. If not, restart Tomcat.
  • At this point, you may find that a data directory has appeared in /var/lib/tomcat7/webapps. Delete it.
  • As root:
# cd /var/lib/tomcat7
# mkdir data
# chown tomcat:tomcat data
  • Inside the /var/lib/tomcat7/webapps/xwiki/WEB-INF directory:
    • Open the xwiki.cfg file and alter the xwiki.work.dir field to read /var/lib/tomcat7/data/xwiki.
    • Open the xwiki.properties file and alter the container.persistentDirectory field to read /var/lib/tomcat7/data/xwiki.
    • Open the hibernate.cfg.xml file and:
      • Comment-out the section entitled "Configuration for the default database".
      • Uncomment the section entitled "PostgreSQL Configuration".
      • Modify the database name (in connection.url), username, and password as desired.
  • Create a role and database in PostgreSQL to match the hibernate configuration.
  • Install postgresql-jdbcAUR from the Arch User Repository.
  • As root:
# cd /usr/share/java/tomcat7
# ln -s /usr/share/java/postgresql-jdbc/postgresql-jdbc4.jar
  • Restart Tomcat.
  • Launch the XWiki application by clicking on /xwiki in Tomcat Manager.
  • Download the XAR file for XWiki and upload it to populate the empty Wiki.

Nginx Proxy Configuration

I found that instructing nginx to proxy to http://localhost:8080/xwiki/ did not work: the generated URLs were incorrect. Contrary to what is indicated in the XWiki documentation, I could not make the URLs correct through the use of HTTP headers.

The only solution I'm aware of so far is to create a new Host element in Tomcat's server.xml file:

  • Duplicate the existing Host element and alter the name attribute to read xwiki.
  • Alter the appBase attribute to read /var/lib/tomcat7/webapps-xwiki.
  • Move the xwiki application from /var/lib/tomcat7/webapps/xwiki to /var/lib/tomcat7/webapps-xwiki/ROOT.
  • Restart Tomcat
  • Add xwiki as an alias to localhost in /etc/hosts (add it to the end of the 127.0.0.1 line).
  • Instruct Nginx to proxy to http://xwiki:8080/ instead.