How to Setup Multiple Wikis?

# 1 Old 07-01-2008, 12:33 PM
mrgreen mrgreen is offline mrgreen's reputation mrgreen is on a distinguished road » Junior Community Member
Join Date: Jun 2008 Posts: 58
Default How to Setup Multiple Wikis?
Hi

Im fairly new to working with linux and dekiwiki. Im trying to set up multiple wikis on one server with no luck. Iv read around and followed Petes guide on multi-tenant setup but it does not work. Im running Deki Wiki 8.05.1 on Ubuntu server 8.04 with VMware. I can get one wiki up and running. The wiki opens by entering the Virtual Machines IP address in the host PCs web browser. Can someone please show me in detail how to setup multiple wikis from scratch as im totally lost. Any help would be appreciated.

Regards
# 2 Old 07-01-2008, 01:19 PM
mhoydis mhoydis is offline mhoydis's reputation mhoydis is on a distinguished road » Community Member
Join Date: Oct 2007 Posts: 141
Sounds like you need to setup your virtualhost with ServerAlias(es) in apache.

where you setup your dekiwiki apache config, probably in /etc/apache2/sites-available/dekiwiki

add ServerAlias line for each wiki you want to run. Like this...
<VirtualHost *>
ServerName server1
ServerAlias wikiapples
ServerAlias wikipears
ServerAlias wikibananas
(rest of config.....)


Additionally, you need to setup DNS so that your aliases resolve. For testing purposes, you can cram the names to resolve to the same IP in your static hosts file in your client OS.
(I'm saying the names server1, wikiapples, wikipears, etc, all need to resolve to the same IP somehow.)

Once you've got this stuff setup, then apache will be able to pass the alias being addressed to the API, which then will know which is the appropriate database to access. If you don't do these steps, obviously the whole setup can only ever know about the instance tied to the "default" header.


Here are PeteE's notes on this subject. http://wiki.developer.mindtouch.com/...i-Tenant_Setup
Last edited by mhoydis : 07-01-2008 at 01:24 PM.
# 3 Old 07-01-2008, 02:36 PM
mrgreen mrgreen is offline mrgreen's reputation mrgreen is on a distinguished road » Junior Community Member
Join Date: Jun 2008 Posts: 58
Default Tried but still no luck...
Hi,

Ok I have tried adding to /etc/apache2/sites-available/dekiwiki. it looks like this -
<VirtualHost *>
ServerName dekiwiki
ServerAlias testwiki
<rest of config under here...>

I also added the whole of the virtual host section from /etc/apache2/sites-available/dekiwiki to /etc/apache2/httpd.conf This is what my config looks like under <wikis> in /etc/dekiwiki/mindtouch.deki.startup.xml -

<config id="default">
<!-- Per instance settings -->
<!-- host: hostname for the wiki. Use * for all hosts. Multiple <host> entries may be used per site.-->
<!-- db-server: hostname/ip of database for this instance-->
<!-- db-port: db port (default 3306 for mysql)-->
<!-- db-catalog: catalog or database name for this instance -->
<!-- db-user: db account to use. Ensure full access to the catalog and rights to exec stored procs.-->
<!-- db-password: password for db account-->
<!-- db-options: other connection string settings. Ensure db connection pooling is enabled and that the connection supports utf8 encoding-->

<host>*</host>

<db-server>localhost</db-server>
<db-port>3306</db-port>
<db-catalog>wikidb</db-catalog>
<db-user>wikiuser</db-user>
<db-password hidden="true">RtGJ1iM1JqrVJbfO</db-password>
<db-options>pooling=true; Connection Timeout=5; Connection Lifetime=30; 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="testwiki">
<!-- Per instance settings -->
<!-- host: hostname for the wiki. Use * for all hosts. Multiple <host> entries may be used per site.-->
<!-- db-server: hostname/ip of database for this instance-->
<!-- db-port: db port (default 3306 for mysql)-->
<!-- db-catalog: catalog or database name for this instance -->
<!-- db-user: db account to use. Ensure full access to the catalog and rights to exec stored procs.-->
<!-- db-password: password for db account-->
<!-- db-options: other connection string settings. Ensure db connection pooling is enabled and that the connection supports utf8 encoding-->

<host>testwiki</host>

<db-server>localhost</db-server>
<db-port>3306</db-port>
<db-catalog>testwikidb</db-catalog>
<db-user>wikiuser</db-user>
<db-password hidden="true">password</db-password>
<db-options>pooling=true; Connection Timeout=5; Connection Lifetime=30; 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>

My LocalSettings.php looks like this -
$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 = "test@test.test";
$wgPasswordSender = "test@test.test";
$wgDekiApiKey = "7ErJDEnpEsYOE7yKUhazO9e6QbicTSF8";

$wgWikis = array(
'Default' => array(
'db-server' => 'localhost',
'db-port' => '3306',
'db-catalog' => 'wikidb',
),
'testwiki' => array(
'db-server' => 'localhost',
'db-port' => '3306',
'db-catalog' => 'testwikidb',
),
);

$wgDBserver = "localhost";
$wgDBname = "wikidb";
$wgDBadminuser = "wikiuser";
$wgDBadminpassword = "RtGJ1iM1JqrVJbfO";

I also created a database called testwikidb and the folder /var/www/dekiwiki/attachments/testwiki/ as explained in Petes guide.
I then restarted apache and dekiwiki via /etc/init.d/apache2 restart and /etc/init.d/dekiwiki restart but still no luck. . Im not sure what im doing wrong. please look over what I did and let me no where im going wrong.

My 1st wiki can still only be accessed by the VMs IP address so how am i meant to access the 2nd wiki? I called my 2nd wiki testwiki. Entering testwiki in the browser brings up a google search result and entering VMs_IP/testwiki opens a subpage in my 1st wiki.
Please help i really need this working and I am way out of my league.

Sorry for the long post.
# 4 Old 07-01-2008, 06:56 PM
mhoydis mhoydis is offline mhoydis's reputation mhoydis is on a distinguished road » Community Member
Join Date: Oct 2007 Posts: 141
sounds like you ignored the part of my post about DNS.
if entering testwiki into a browser produces a google search page, then it seems that testwiki is still not resolving.
you should make it resolve to the same IP as the "VMs IP" via DNS or netbios or black magic or smoke signals or whatever you want. you need all the names of all your wiki instances to resolve to the same IP.
# 5 Old 07-02-2008, 08:32 AM
mrgreen mrgreen is offline mrgreen's reputation mrgreen is on a distinguished road » Junior Community Member
Join Date: Jun 2008 Posts: 58
Default It Works!
Ok thanks man iv got it working. I really appreciate the help. I did forget about the host file. On my windows machine i added -

<Virtual Machines IP> testwiki dekiwiki

to my C:\WINDOWS\system32\drivers\etc\hosts file. I did not add anything to my linux virtual machine /etc/hosts file. I'll use this setup for testing then once everything is working smooth i can resolve the wikis with DNS.

I have another question. I need the wikis to open on -
http://Some_Name/testwiki/wiki and
http://Some_Name/dekiwiki/wiki
so that i can add other sites later - http://Some_Name/testwiki/example_site1 and http://Some_Name/dekiwiki/example_site2
How would i go about doing this? should I add http://Some_Name/testwiki/wiki and http://Some_Name/dekiwiki/wiki as the ServerAlias in /etc/apache2/httpd.conf and /etc/apache2/sites-available/dekiwiki?

Thanks again man!
# 6 Old 07-02-2008, 02:16 PM
mrgreen mrgreen is offline mrgreen's reputation mrgreen is on a distinguished road » Junior Community Member
Join Date: Jun 2008 Posts: 58
Hi,

I have added http://Some_Name/testwiki/wiki and http://Some_Name/dekiwiki/wiki as the ServerAlias in /etc/apache2/httpd.conf and /etc/apache2/sites-available/dekiwiki. I have also replaced testwiki with http://Some_Name/testwiki/wiki in the /etc/dekiwiki/mindtouch.deki.startup.xml and LocalSettings.php. And i have replaced testwiki and dekiwiki in my windows hosts file with http://Some_Name/testwiki/wiki and http://Some_Name/dekiwiki/wiki respectively but entering either of these URLs in my windows web browser does not work

Does anyone know what to do to get this to work? I really need my wikis setup this way. Any help would be nice.
Regards.
# 7 Old 07-02-2008, 07:05 PM
crb crb is online now crb's reputation crb has a reputation beyond reputecrb has a reputation beyond reputecrb has a reputation beyond reputecrb has a reputation beyond reputecrb has a reputation beyond reputecrb has a reputation beyond reputecrb has a reputation beyond repute » Purveyor of Awesome
Join Date: Feb 2008 Location: London upon Thames Posts: 2,520
See this thread. Is there a reason you want to use the same name, and not use a virtual host?
# 8 Old 07-03-2008, 07:08 AM
mrgreen mrgreen is offline mrgreen's reputation mrgreen is on a distinguished road » Junior Community Member
Join Date: Jun 2008 Posts: 58
Hi,

I am trying to use virtual hosts but maybe im not doing it right. My wikis need to open up on http://server_name/department1/wiki and http://server_name/department2/wiki because they are being setup for different departments and this URL format is needed so that either department can add department specific sites later on. Eg. http://server_name/department2/forum or http://server_name/department1/bug_tracker.

So far my wikis open when entering http://testwiki/ and http://dekiwiki/.
As far as I know to setup virtual hosts i have to edit /etc/apache2/httpd.conf and change virtual hosts section. My virtual hosts looks like this now -

<VirtualHost *>
ServerName server_name
ServerAlias http://server_name/department1/wiki
ServerAlias http://server_name/department2/wiki
(rest of config stuff here)

but it does not work. They just open up as sub-pages on my 1st wiki. Is there anything else i got to edit like the /etc/apache2/sites-available/dekiwiki or the /etc/dekiwiki/mindtouch.deki.startup.xml or LocalSettings.php? Right now i cant use DNS until my wikis are setup 100% so for testing, what should i enter in my hosts file to resolve the names?
Last edited by mrgreen : 07-03-2008 at 07:15 AM.
# 9 Old 07-03-2008, 01:08 PM
mrgreen mrgreen is offline mrgreen's reputation mrgreen is on a distinguished road » Junior Community Member
Join Date: Jun 2008 Posts: 58
Anyone???
# 10 Old 07-03-2008, 06:04 PM
royk royk is offline royk's reputation royk has a reputation beyond reputeroyk has a reputation beyond repute » MindTouch Team
Join Date: Feb 2007 Posts: 1,874
You cannot set-up Deki off anything but a root domain - it will not operate from that subfolder.

Is there any reason you wouldn't install one instance and then set-up the first subtree for each of those directories?

Likewise, you can also switch to:

dept1.yourwiki.com
dept2.yourwiki.com

To get things working.
Found a bug? Report it.
Page 1 of 3 1 2 3 >

Thread Tools

Search this Thread

Search this Thread Advanced Search

Display Modes

Powered by MindTouch 2010