Dashboard > GreenPepper Open Documentation Refactoring > ... > 4. Advanced XWiki > Using an external database with XWiki
  GreenPepper Open Documentation Refactoring Log In View a printable version of the current page.  
  Using an external database with XWiki
Added by Francois Denommee, last edited by Francois Denommee on Nov 24, 2009  (view change)
Labels: 
(None)

Using an external database with XWiki

Web Container

Jetty

By default, the standalone XWiki distribution is using Jetty as the web container.

To use an external database for GreenPepper inside this distribution, you will need to :

  • Copy the JDBC driver to the directory WEB-INF/lib
  • Create a file WEB-INF/jetty-web.xml with the information about the database connectivity (JDBC). This example is defining a MySql database :
    WEB-INF/jetty-web.xml
    <?xml version="1.0"?>
    <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
    <Configure class="org.mortbay.jetty.webapp.WebAppContext">
        <New id="GreenPepperDS" class="org.mortbay.jetty.plus.naming.Resource">
            <Arg></Arg>
            <Arg>java:comp/env/jdbc/GreenPepperDS</Arg>
            <Arg>
                <New class="org.apache.commons.dbcp.BasicDataSource">
                    <Set name="driverClassName">com.mysql.jdbc.Driver</Set>
                    <Set name="url">jdbc:mysql://localhost:3306/greenpepper?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8</Set>
                    <Set name="username">[dbuser]</Set>
                    <Set name="password">[dbpassword]</Set>
                    <Set name="maxActive">5</Set>
                    <Set name="maxIdle">1</Set>
                    <Set name="maxWait">10000</Set>
                </New>
            </Arg>
        </New>
    </Configure>

Others

Follow the guide of your container to setup a JNDI datasource

Configuration

Go to the configuration screen of GreenPepper by clicking the icon or by browsing to *http://localhost:8080/xwiki/index.greenpepper* URL (make sure to point to your server host and port!).

Under the Database tab, you will need to use the Custom Installation type, select your database provider and enter the JNDI name of the datasource.

Make sure the Test link is successfull.

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators