Configuring the multi-tenancy feature
A multi-tenant setup (a.k.a "virtual mode", "multi-wiki" or "farm mode") allows you to have several wikis running on the same XWiki instance (i.e. in the same JVM).
This is implemented by having each wiki have its own schema or its own database in the DBMS (whether it's implemented as schema or databases depends on the DBMS).
The main advantage of multi-tenancy is performance optimization. A single XWiki instance on a physical machine (thus a single Servlet Container) will perform much better than having several XWiki instances running on the same machine, which wouldn't scale. As an example known XWiki multi-tenant instances host several hundreds to several thousands wikis on a single XWiki instance.
Requirements
The multi-tenancy feature is currently supported only on some DBMS:
- MySQL (using a different database for each subwiki)
- Oracle (using a different schema for each subwiki)
- HSQLDB (using a different schema for each subwiki)
- PostgreSQL (using a different schema for each subwiki)
- Derby is currently not supported
In addition to having a supported DBMS you'll also need:
- To choose one instance of XWiki that has been installed on your network and that wil act as the main wiki. The database name for this wiki should be xwiki. If you've still got to install the XWiki instance, please refer to the installation guide and install XWiki Enterprise first.
- Admin privileges on this XWiki instance
- You need to be sure that the xwiki user used to create the main database has the correct permissions to be able to create other schemas or databases since each subwiki will create a new schema/database. Refer to the Databases install guides.
Configuration
You need to install the Wiki Manager Application.
You're now ready to create sub wikis by following the Wiki Manager Application documentation.
Configuration prior to XWiki 5.0
- Stop your XWiki instance, edit the WEB-INF/xwiki.cfg file, look for the xwiki.virtual property and set it to 1: xwiki.virtual=1
- Restart your XWiki instance