Saturday, September 26, 2009

How to Install Xwiki on Ubuntu

(This 3 year old post probably isn't relevant any more and sorry to those that have asked for help but I don't even have a ubuntu installation to check things with anymore. Good luck solving your problems)

Lately I've battled with installing Xwiki on Ubuntu. It is written in Java and while the stand-alone installer worked fine on windows, no one wants a windows server.


This is the process I used to install XWiki on Ubuntu Desktop 9.04:

1. Instal everything for a webserver using Synaptic: (I installed php as well as I knew I would use it later)
apache2, tomcat6, tomcat6-examples, tomcat6-user, mysql-server, mysql-client

2. Check tomcat is working: localhost:8080 you should see some welcome information for tomcat.

3. Download the current xwiki.war.

4. Copy it to the webapps directory of tomcat:
sudo cp xwiki-enterprise-2.0.war /var/lib/tomcat6/webapps/xwiki.war
5. Download the latest version of the mysql connector

6. Copy it to the lib directory of xwiki:
sudo cp mysql-connector-java-5.1.6.jar /var/lib/tomcat6/webapps/xwiki/WEB-INF/lib
7. Create a mysql database and set the permissions for a new user 'xwiki':
mysql -u root -p -e "create database xwiki"
mysql -u root -p -e "grant all privileges on xwiki.* to xwiki@127.0.0.1 identified by 'xwiki'"

8. Edit the xwiki/WEB-INF/hibernate.cfg.xml file,
 sudo vim /var/lib/tomcat6/webapps/xwiki/WEB-INF/hibernate.cfg.xml
replace the similar section with this:
 <property name="connection.url">jdbc:mysql://localhost/xwiki</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
 9. Change the security settings in Tomcat:
sudo vim /etc/init.d/tomcat
find and set the following to 'no':
 TOMCAT6_SECURITY=NO
10. Restart tomcat
sudo service tomcat6 restart
11. Head to localhost:8080.and you should come across a page which suggests you import the default .xar templates.
default administrator: username=Admin, password=admin
Log in: localhost:8080/xwiki/login/XWiki

Have fun importing the template and making your new spaces, pages and blogs.

References:
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Installation
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationMySQL
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/ImportExport

7 comments:

  1. That was very helpful, thanks !!

    ReplyDelete
  2. Just what I was looking for. Many thanks!

    ReplyDelete
  3. I haven't tried yet but this was very very useful. I couln't find this information at the xwiki page.
    Many thanks

    ReplyDelete
  4. Thanks a lot. Worked just fine for me.

    ReplyDelete
  5. There does not seem to be a WEB-INF/lib directory. I created it and used wget to pull in mysql-connector-java-5.1.17.jar file. But I cannot do the next step because there is no hibernate.cfg.xml file. By some chance are your instructions assuming a local workstation login rather than an ssh login to a remote server?

    ReplyDelete
  6. Thanks for your How To. Very helpful. You also needs to install libcglib-java, which isn't installed on Ubuntu by default.

    ReplyDelete
  7. Thanks, it was very useful. If we have installed Tomcat 6 by directly extraction from a zip file then we do not need to do step 9

    --Natraj

    ReplyDelete