This FAQ assumes you are currently running a single tenant MindTouch installation, and will assist you in adding on additional tenants. Note that additional tenants requires additional licensing.
To create a new database, we have a script in /var/www/dekiwiki/maintenance/createdb.sh (Linux) and C:\Program Files\MindTouch\MindTouch\web\maintenance\createdb.sh (Windows).
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!
2. Configure 'mindtouch.deki.startup.xml'
Edit your mindtouch.deki.startup.xml in either /etc/dekiwiki (Linux) or C:\Program Files\MindTouch\MindTouch\web\bin\ (Windows) 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="domain.com">
<host>domain.com</host>
<host>wiki1alias.domain.com</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="domain2.com">
<host>domain2.com</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>
You will need to reconfigure your LocalSettings.php file in either /var/www/dekiwiki (Linux) or C:\Program Files\MindTouch\MindTouch\web\ (Windows) to allow for multiple tenants.
A single tenant default LocalSettings.php file can be found below:
<?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" ); $wgEmergencyContact = "john@doe.com"; $wgPasswordSender = "john@doe.com"; $wgDekiApiKey = "12345"; $wgDBserver = "localhost"; $wgDBname = "wiki1"; $wgDBadminuser = "wiki1dbuser"; $wgDBadminpassword = "wiki1dbpasswd"; ?>
You will need now to modify the file to include an array of tenants. To do so, add in the "$wgWikis" section shown below, and copy in the database details from the single tenant as formatted below. Then, be sure to add in details for the second tenant as well:
<?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" );
$wgEmergencyContact = "john@doe.com";
$wgPasswordSender = "john@doe.com";
$wgDekiApiKey = "12345";
$wgWikis = array(
'domain.com' => array(
'db-server' => 'localhost',
'db-port' => '3306',
'db-catalog' => 'wiki1',
'db-user' => 'wiki1dbuser',
'db-password' => 'wiki1dbpasswd',
),
'domain2.com' => array(
'db-server' => 'localhost',
'db-port' => '3306',
'db-catalog' => 'wiki2',
'db-user' => 'wiki2dbuser',
'db-password' => 'wiki2dbpasswd',
),
);
?>
We recommend using the multiple Apache conf files for granularity purposes; should you ever need to configure redirects for specific sites you'll be able to in their respective Apache conf file.
If you already have an Apache file you've been using on a single tenant installation, the best method to create a new Apache configuration file would be to copy and rename. For instance, if you're setting up a new tenant for "domain2.com", and you already have "domain.com" configured for the single tenant which relies on "deki-apache.conf" for Apache purposes, you can run the following command on Linux:
cp /etc/httpd/conf.d/deki-apache.conf /etc/httpd/conf.d/domain2.conf
Then, edit the 'domain2.conf' file and change all references to reflect the new domain.
The last step for new tenant creation on multi-tenant installations is to ensure packages are present for the new tenant. To ensure this, run the following command:
cp -R /var/www/dekiwiki/packages/default /var/www/dekiwiki/packages/[new instance name]
Here, substitute in the new tenant name; this should mirror the 'config id' of this tenant from the Apache configuration file above.
Then, enter the Control Panel and click on "Package Importer". Click "Force Remiport" to complete this process.
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by
should it not be something like this?
--storageDir /var/www/wiki1
Piko edited 16:10, 3 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 03:23, 24 Jul 2008
RewriteCond %{HTTP_HOST} ^wiki.example.org$
RewriteRule ^/favicon\.ico$ /favicon-you-want.ico [T=image/x-icon,L]