Configuration

Version 27.1 by Ricardo Rodríguez on 2008/08/17
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Configuration

One you have XWiki installed you'll want to configure it. Configuration can be done in 2 ways:

  • by stopping the XWiki instance and editing the xwiki/WEB-INF/xwiki.cfg file, and then restarting XWiki
  • by logging in as a user with admin rights and going to the Administration page (when using the XWiki 1.0 skin, there's a an "Administration" link in the top right corner of the screen - You can also go directly to http://localhost:8080/xwiki/bin/admin/XWiki/XWikiPreferences//). This allows to keep the Server running while making the changes.

Note that some configurations are only accessible from the xwiki.cfg file and have no equivalent on the Administration page.

There are various things you can configure:

Invalid macro parameters used for the [toc] macro. Cause: [Failed to validate bean: [must be greater than or equal to 1]]. Click on this message for details.

Enable superadmin account

Edit the xwiki.cfg file and enable the xwiki.superadminpassword property. For example:

# Enable to allow superadmin. It is disabled by default as this could be a security breach if
# it were set and you forgot about it.
xwiki.superadminpassword=system

When logging in, the username will be "superadmin" and the password will be the one you set in the xwiki.superadminpassword property.

Language settings

To define the default language for your wiki go to the Administration page and in the Preferences tag locate the "Default Language" field and enter the language code for the language you wish to use. For example: "en" for English, "fr" for French, "de" for German, etc.

In addition you can configure you wiki to be multilingual. See the I18 user page for more information.

Wiki Access Configuration

The first thing you will want to do is configure a policy access for your wiki. Depending on what you intend to use your wiki for, you have several options:

Open Wiki

TODO

Public Wiki

TODO

Private Wiki with password

Global rights

In Global rights set User:XWikiGuest, Groups:, Level:register, Allow-Deny:Allow.

Registration

In Preferences under Registration set Use email verification:yes. fill the other fields appropriately.

Private Wiki with token

TODO

Enabling/Disabling Statistics

To disable the Statistics feature, edit your xwiki.cfg file and replace the following properties as shown here:

xwiki.stats=0
xwiki.stats.default=0

where:

  • xwiki.stats controls whether Statistics are on or off
  • xwiki.stats.default controls whether Statistics are on or off by default for the current Wiki. This is useful in Virtual Wiki mode. A wiki can decide whether Statistics is on/off by setting the "statistics" field in XWiki.XWikiPreferences. If no such field is defined the the default value xwiki.stats.default is used.

To enable Statistics, change "0" to "1".

Optional Store Features

XWiki stores all document attachment versions by default. This is very memory consuming (both RAM and HDD). If you need only latest versions of attachments, you can disable attachment version control by editing your xwiki.cfg and adding:

xwiki.store.attachment.versioning=0

Customizing the Skin

See the Skin Guide.

Security configuration

See the Security Guide.

Customizing Menus

The first thing to understand is that menus depend on the skin you're using. If you're using the 1.0 skin it's likely you're using the Panels Application to provide the different menu panels you see on the left or right of your wikis. Check the Panels Application to know more on how to configure/modify them.

Encoding

See the Encoding Guide.

User Authentication

See the Authentication Guide.

Customizing the registration page

The default registration page is defined as a template on the file system (named registerinline.vm). However it's possible to easily override it by creating a page named XWiki.Registration.

Logging

See the Logging page.

Interwiki linking is a short hand syntax for linking to pages on other websites. For example, you could link to http://en.wikipedia.org/wiki/InterWiki just by typing [InterWiki@WikiPedia].

Since XWiki renders wiki syntax using the Radeox engine, it supports Interwiki links in much the same way as SnipSnap

To configure Interwiki links on your wiki:

  • Create a file named [location from where you start your container]/conf/intermap.txt
  • Fill intermap.txt with content like:
IMDB http://us.imdb.com/Title?
OpenWiki http://openwiki.com/?
SourceForge http://sourceforge.net/
TWiki http://twiki.org/cgi-bin/view/
Why http://clublet.com/c/c/why?
Wiki http://c2.com/cgi/wiki?
WikiPedia http://www.wikipedia.com/wiki/

You can of course add your own entries.

  • Note that Radeox's parser for intermap.txt is very fragile. A blank line at the bottom of the file is enough to make it fall over.
  • Restart XWiki (you'll need to restart XWiki every time you change intermap.txt) and try out an Interwiki link.
  • If it does not work, check your xwiki.log file. You'll see if conf/intermap.txt could not be found, or if there was an error parsing it.

Setting the default editor to use (Wiki or WYSIWYG)

Go the Administration screen, then click on the "General" icon and select the default editor to use, as shown on the following screenshot:

defaulteditor.png

Short URLs

It's possible to configure XWiki so that is uses shorter URLs.

Configure the names of database schemas (since 1.6M1).

Sometimes, especially in enterprise environment, we need control names of database schemes, other than default.

  • xwiki.db -- name of database scheme of main wiki.
  • xwiki.db.prefix -- usefull mainly for virtual wikies, where we have database scheme for each virtual wiki. This prefix is added to database scheme name after usual mapping between wiki names and schemes.

Turning off comments or attachments

You need to change the XWiki.XWikiPreferences class like this:

  • Go to /xwiki/bin/edit/XWiki/XWikiPreferences?editor=class
  • Add a new property called showcomments (or showattachments for turning off attachments) of type String Class
  • Go to /xwiki/bin/edit/XWiki/XWikiPreferences?editor=object&classname=XWiki.XWikiPreferences and write no in the showcomments (or showattachments) field

    That's it, the comments (or attachments) are gone. If you want to re-enable them, replace the "no" value with "yes".

Configure edit comment behavior

When page editing you can add a comment of changes in special comment field by default (Look at PageEditing). You can disable this feature by set xwiki.editcomment=0 in xwiki.cfg.

When edit comment feature is enabled, you also can set edit comment mandatory by set xwiki.editcomment.mandatory=1 in xwiki.cfg. This will show popup window with the request to set edit comment if there is no comment entered. It doesn't allow to set empty comment. If you want a popup, but want to be able to set empty edit comment, set xwiki.editcomment.suggested=1 in xwiki.cfg

If you set edit comment as mandatory or suggested, you can also remove comment field from page editing form and use only popup window for set edit comment. Set xwiki.editcomment.hidden=0 in xwiki.cfg to do this.

You can use the special fields in XWikiPreferences object instead of edit xwiki.cfg. These fields are: editcomment, editcomment_mandatory, editcomment_suggested and editcomment_hidden.

Configuring the SMTP server

If you're planning to use XWiki's feature that send emails you'll need to configure the SMTP server used and the email address under which XWiki will send emails.

To configure these go to the Administration page (http:///xwiki/bin/admin/XWiki/XWikiPreferences), click on the "general" icon and modify the Admin email field to set the email under which XWiki emails will be sent and modify the Outgoing SMTP Server field to set the SMTP server to use, as shown on the figure below.

emailconfiguration.png

Now xwiki can't configure password for SMTP user. Hence, you should use a SMTP server without password Authentication.

Redirections

XWiki supports defining redirections for incoming requests. To activate this feature modify your xwiki.cfg file and set the following property:

xwiki.preferences.redirect=1

Then for each redirection you want to add, add a XWiki.GlobalRedirect object to your main wiki's XWiki.XWikiPreferences document. The XWiki.GlobalRedirect object has 2 fields: pattern and destination. The URL received is matched on pattern and if there's a match it's replaced with the value from destination. XWiki then redirects to the new URL.

Customizing the PDF export Look & Feel

It is posible to pass a pdftemplate parameter to the export process as in http://yourserver/xwiki/bin/export/Space/Page?format=pdf&language=en&pdftemplate=XWiki.PDFTemplate. XWiki.PDFTemplate is an instance of a newly created class PDFclass with style as only property. style stores CSS code. Don't add blank line between the rules. The field is parsed and rendered, so a blank line causes a paragraph to appear there, which breaks the CSS.

Even though RTF export is expected to work the same way, there are still some isues to be solved affecting how css properties control the final layout.

A new rendering subsystem is on its way, so things could change in the following few weeks. You may want keep an eye on this

XWikiExport200805192259.png

Sample xwiki.cfg

xwiki.version=1.1-SNAPSHOT
xwiki.base=../../
xwiki.store.class=com.xpn.xwiki.store.XWikiHibernateStore
xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml
xwiki.store.hibernate.updateschema=1
xwiki.store.hibernate.custommapping=1

\#\# Jcr Store configuration
\#xwiki.store.class=com.xpn.xwiki.store.jcr.XWikiJcrStore
\#xwiki.store.attachment.class=com.xpn.xwiki.store.jcr.XWikiJcrAttachmentStore
\#xwiki.store.versioning.class=com.xpn.xwiki.store.jcr.XWikiJcrPropertyVersioningStore
\#xwiki.store.jcr.mapping=WEB-INF/classes/jcrmapping.xml
\#xwiki.store.jcr.provider=com.xpn.xwiki.store.jcr.JackRabbitJCRProvider
\#xwiki.store.jcr.jackrabbit.repository.config=WEB-INF/classes/jackrabbit/repository.xml
\#xwiki.store.jcr.jackrabbit.repository.path=jackrabbitrepo
\#xwiki.store.jcr.jackrabbit.nodetypes.config=WEB-INF/classes/jackrabbit/nodetypes.cnd

xwiki.store.cache=1
xwiki.store.cache.capacity=100
xwiki.monitor=1

\# List of active plugins.
xwiki.plugins=com.xpn.xwiki.monitor.api.MonitorPlugin,\\
             com.xpn.xwiki.plugin.calendar.CalendarPlugin,\\
             com.xpn.xwiki.plugin.feed.FeedPlugin,\\
             com.xpn.xwiki.plugin.ldap.LDAPPlugin,\\
             com.xpn.xwiki.plugin.google.GooglePlugin,\\
             com.xpn.xwiki.plugin.flickr.FlickrPlugin,\\
             com.xpn.xwiki.plugin.mail.MailPlugin,\\
             com.xpn.xwiki.plugin.packaging.PackagePlugin,\\
             com.xpn.xwiki.plugin.query.QueryPlugin,\\
             com.xpn.xwiki.plugin.svg.SVGPlugin,\\
             com.xpn.xwiki.plugin.charts.ChartingPlugin,\\
             com.xpn.xwiki.plugin.fileupload.FileUploadPlugin,\\
             com.xpn.xwiki.plugin.image.ImagePlugin,\\
             com.xpn.xwiki.plugin.captcha.CaptchaPlugin,\\
             com.xpn.xwiki.plugin.userdirectory.UserDirectoryPlugin,\\
             com.xpn.xwiki.plugin.usertools.XWikiUserManagementToolsImpl,\\
             com.xpn.xwiki.plugin.zipexplorer.ZipExplorerPlugin,\\
             com.xpn.xwiki.plugin.autotag.AutoTagPlugin

\# This parameter allows XWiki to operate in Hosting mode
\# allowing to create multiple wikis having their own database
\# and responding to different URLs
xwiki.virtual=0
xwiki.virtual.redirect=http://127.0.0.1:9080/xwiki/bin/Main/ThisWikiDoesNotExist

\# This parameter will activate the exo integration
xwiki.exo=0

xwiki.authentication=form
xwiki.authentication.validationKey=totototototototototototototototo
xwiki.authentication.encryptionKey=titititititititititititititititi
xwiki.authentication.cookiedomains=xwiki.com,wiki.fr
\# Comment if you want to enable logout only for /bin/logout/XWiki/XWikiLogout
xwiki.authentication.logoutpage=/[^/]+/logout/*

\# Stats configuration allows to globally activate/deactivate stats module
\# it is also possible to choose a different stats service to record
\# statistics separately from XWiki.
\# Note: Statistics are disabled by default for improved performances.
xwiki.stats=0
xwiki.stats.default=1
xwiki.stats.class=com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl

xwiki.encoding=ISO-8859-1
xwiki.render.macromapping=1
xwiki.backlinks=1
xwiki.tags=1

\#\# Use edit comments
xwiki.editcomment=1
\#\# Hide editcomment field and only use JS
xwiki.editcomment.hidden=0
\#\# Make edit comment mandatory
xwiki.editcomment.mandatory=0
\#\# Make edit comment suggested (asks 1 time if the comment is empty. 1 shows one popup if comment
\#\# is empty. 0 means there is no popup. This setting is ignored is mandatory is set)
xwiki.editcomment.suggested=0

\# GraphViz plugin configuration. The GraphViz plugin is not configured by default.
\# To enable it, add "com.xpn.xwiki.plugin.graphviz.GraphVizPlugin" to the list of plugins
\# in the xwiki.plugins property.
\# Uncomment and set the locations of the Dot and Neato executables
\#xwiki.plugin.graphviz.dotpath=c:/Program Files/ATT/GraphViz/bin/dot.exe
\#xwiki.plugin.graphviz.neatopath=c:/Program Files/ATT/GraphViz/bin/neato.exe

xwiki.plugin.laszlo.baseurl=/openlaszlo/xwiki/
xwiki.plugin.laszlo.path=c:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/openlaszlo/xwiki/

xwiki.plugin.image.cache.capacity=30

xwiki.plugin.captcha=1

\#\# Personal config

\# Enable to allow superadmin. It is disabled by default as this could be a security breach if
\# it were set and you forgot about it.
\#xwiki.superadminpassword=system

xwiki.authentication.ldap=0
xwiki.authentication.ldap.server=172.29.116.202
xwiki.authentication.ldap.check_level=1
xwiki.authentication.ldap.port=389
xwiki.authentication.ldap.base_DN=dc=necf,dc=fr
xwiki.authentication.ldap.bind_DN=cn={0},cn=Users,dc=necf,dc=fr
xwiki.authentication.ldap.bind_pass={1}
xwiki.authentication.ldap.UID_attr=sAMAccountName
xwiki.authentication.ldap.fields_mapping=name=sAMAccountName,last_name=sn,first_name=givenName,fullname=displayName,email=mail,ldap_dn=dn

xwiki.authentication.unauthorized_code=200

\# This parameter will activate the sectional editing
xwiki.section.edit=1

\# Uncomment if you want to ignore requests for unmapped actions, and simply display the document
\# xwiki.unknownActionResponse=view

\#\# WYSIWYG Editor configuration

\# You can configure the toolbars you wish to see in the WYSIWYG editor by defining the
\# xwiki.wysiwyg.toolbars property.
\# When not defined it defaults to:
\#   xwiki.wysiwyg.toolbars=texttoolbar, listtoolbar, indenttoolbar, undotoolbar, titletoolbar, \
\#                          styletoolbar, horizontaltoolbar, attachmenttoolbar, macrostoolbar, \
\#                          tabletoolbar, tablerowtoolbar, tablecoltoolbar, linktoolbar
\# The full list of toolbars includes the one defined above and the following ones:
\#   subtoolbar, findtoolbar, symboltoolbar

\#\# Skin configuration

xwiki.defaultskin=albatross
xwiki.defaultbaseskin=albatross
Tags:
   

Get Connected