This is a quick FAQ on running dekiwiki in a multi-tenant configuration. Note, this functionality is only available in Deki Wiki 1.8.3 and greater.
Edit your mindtouch.deki.startup.xml (in /etc/dekiwi) and add new <config> elements beneath the <wikis> element:
<script>
<!-- register Deki services -->
<action verb="POST" path="/host/load?name=mindtouch.deki" />
<action verb="POST" path="/host/load?name=mindtouch.deki.services" />
<action verb="POST" path="/host/load?name=mindtouch.indexservice" />
<!-- start Deki services -->
<action verb="POST" path="/host/services">
<config>
<wikis>
<config id="wiki1.example.org">
<host>wiki1.example.org</host>
<host>wiki1alias.example.org</host> <!-- this is an alias similar to how Apache VirtualHost works -->
<db-server>localhost</db-server>
<db-port>3306</db-port>
<db-catalog>wiki1</db-catalog>
<db-user>wikiuser</db-user>
<db-password hidden="true">yourpass</db-password>
<db-options>pooling=true; Connection Timeout=5; Protocol=socket; Min Pool Size=2; Max Pool Size=50; Connection Reset=false;character set=utf8;ProcedureCacheSize=25;Use Procedure Bodies=true;</db-options>
</config>
<config id="wiki2.example.org">
<host>wiki2.example.org</host>
<db-server>localhost</db-server>
<db-port>3306</db-port>
<db-catalog>wiki2</db-catalog>
<db-user>wikiuser</db-user>
<db-password hidden="true">yourpass</db-password>
<db-options>pooling=true; Connection Timeout=5; Protocol=socket; Min Pool Size=2; Max Pool Size=50; Connection Reset=false;character set=utf8;ProcedureCacheSize=25;Use Procedure Bodies=true;</db-options>
</config>
<globalconfig>
<!-- this section allows you to set/override any value in the wiki's config table
For example, if you'd like to override the ui/analytics-key (google anlaytics) for all wikis, you could add this:
<ui>
<analytics-key>UA-68075-12</analytics-key>
</ui>
-->
</globalconfig>
</wikis>
<!-- Service startup -->
<!-- deki: relative path for deki-api service. I.e., http://host/deki -->
<!-- sid: the serviceid points to a class that represents the service for startup-->
<path>deki</path>
<sid>http://services.mindtouch.com/deki/draft/2006/11/dekiwiki</sid>
<deki-path>/var/www/dekiwiki</deki-path>
<imagemagick-convert-path>/usr/bin/convert</imagemagick-convert-path>
<imagemagick-identify-path>/usr/bin/identify</imagemagick-identify-path>
<imagemagick-timeout>30000</imagemagick-timeout>
<api-key>12345</api-key>
<indexer>
<path.store>/var/www/dekiwiki/bin/cache/luceneindex/$1</path.store> <!-- $1 will be replaces with the wiki id (ex: wiki2.example.org) -->
<filter-path extension="doc">/var/www/dekiwiki/bin/filters/wvText</filter-path>
<filter-path extension="pdf">/var/www/dekiwiki/bin/filters/pdf2text</filter-path>
<filter-path extension="xhtml">/var/www/dekiwiki/filters/html2text</filter-path>
<filter-path extension="html">/var/www/dekiwiki/bin/filters/html2text</filter-path>
<filter-path extension="htm">/var/www/dekiwiki/bin/filters/html2text</filter-path>
<filter-path extension="docx">/var/www/dekiwiki/bin/filters/docx2txt</filter-path>
<filter-path extension="odt">/var/www/dekiwiki/bin/filters/odt2txt</filter-path>
<filter-path extension="odp">/var/www/dekiwiki/bin/filters/odp2txt</filter-path>
<filter-path extension="ppt">/var/www/dekiwiki/bin/filters/ppt2txt</filter-path>
<filter-path extension="pptx">/var/www/dekiwiki/bin/filters/pptx2txt</filter-path>
<filter-path extension="xls">/var/www/dekiwiki/bin/filters/xls2txt</filter-path>
<filter-path extension="pl"></filter-path>
<filter-path extension="c"></filter-path>
<filter-path extension="h"></filter-path>
<filter-path extension="inc"></filter-path>
<filter-path extension="php"></filter-path>
<filter-path extension="cs"></filter-path>
<filter-path extension="txt"></filter-path>
<filter-path extension="csv"></filter-path>
<filter-path extension="xml"></filter-path>
<filter-path extension="xsl"></filter-path>
<filter-path extension="xslt"></filter-path>
</indexer>
</config>
</action>
</script>
<?php
$IP = "/var/www/dekiwiki";
ini_set( "include_path", ".:/var/www/dekiwiki:/var/www/dekiwiki/includes:/var/www/dekiwiki/languages" );
require_once( "includes/DefaultSettings.php" );
$wgDekiApiKey = "12345";
// this section is required for performing database updates via maintenance/update-db.php
$wgWikis = array(
'wiki1.example.org' => array(
'db-server' => 'localhost',
'db-port' => '3306',
'db-catalog' => 'wiki1',
),
'wiki2.example.org' => array(
'db-server' => 'localhost',
'db-port' => '3306',
'db-catalog' => 'wiki2',
),
);
?>
To create a new database, we have a script in maintenance/createdb.sh
petee@host:/var/www/dekiwiki/maintenance$ ./createdb.sh Usage: ./createdb.sh: --dbName database_name --dbAdminUser database_admin_user \ --dbAdminPassword database__admin_password --dbServer database_server \ --dbWikiUser database_wiki_user --wikiAdmin admin_login \ --wikiAdminPassword admin_password --wikiAdminEmail admin_email \ [--maintenanceDir wiki_maintenance_directory] Parameters: --dbName: Name of the database catalog to create. --dbAdminUser: The database admin user used to create the database. --dbAdminPassword: The password for the database admin user. --dbServer: The MySQL host where the database will be created. --dbWikiUser: The non-admin mysql account for the wiki database. --wikiAdmin: The name of the Deki Wiki administrator account. --wikiAdminPassword: The password for the Deki Wiki administrator account. --wikiAdminEmail: The email address for the Deki Wiki administrator account. OPTIONAL Parameters: --maintenanceDir: Deki Wiki maintenance directory --storageDir: The path to the file storage directory --s3PublicKey: S3 public key --s3PrivateKey: S3 private key --s3Bucket: S3 bucket --s3Prefix: prefix for all files stored on S3. Allows multiple wikis to share the same bucket --s3Timeout: timeout for S3 requests
Here's an example invocation:
./createdb.sh --dbName wiki1 --dbAdminUser root --dbAdminPassword root_mysql_pass \ --dbServer localhost --dbWikiUser wikiuser --wikiAdmin Admin \ --wikiAdminPassword my_wiki_admin_password --wikiAdminEmail petee@mindtouch.com \ --storageDir /var/www/dekiwiki/attachments/wiki1
NOTE: If the "wikiuser" doesn't exist in your mysql server the user will be created but have a blank password so please remember to set a password!
If you've already got a single-tenant wiki you shouldn't need to do anything else here. If you're starting from scracth, use the web installer to generate them for the first wiki.
You can use a single apache configuration with multiple wikis by modifying your VirtualHost configuration and adding the ServerAlias directive:
<VirtualHost *:80>
ServerName dekiwiki
ServerAlias wiki1.example.org
ServerAlias wiki2.example.org
#ServerAlias * # note, this will match all Host headers
DocumentRoot /var/www/dekiwiki
<!-- snip -->
Also - if one decided not to go for multi-tenant, but yet needed to keep certain groups of users separate, it appears you can do this with roles and permissions. However, does searching follow the rules? If user X can use only sub-page X and its children, when user X searches, can s/he see user Z's pages?
The search function does respect user permissions so you shouldn't see any search results for pages/files that you can't view.
Thanks
Rick
should it not be something like this?
--storageDir /var/www/wiki1
Piko edited 00:10, 4 Mar 2008
/etc/dekiwiki/mindtouch.deki.startup.xml
/var/www/dekiwiki/LocalSettings.php
/etc/apache2/httpd.conf (In this file the closing tag is missching: </VirtualHost>
/var/www/dekiwiki/maintenance from this dir type: ./createdb.sh etcetera edited 11:23, 24 Jul 2008
RewriteCond %{HTTP_HOST} ^wiki.example.org$
RewriteRule ^/favicon\.ico$ /favicon-you-want.ico [T=image/x-icon,L]