How to Install Multiple TikiWikis Using Subdomains on Windows XP
This page describes how to install multiple TikiWiki applications under one Apache web (HTTP) server using the “MultiTikiâ€-subdomain approach.
The PDF Document describing these steps can be found here:
MultiTiki Apache and Windows Configuration.pdf (390.57 Kb)
Windows XP Professional 2002
Service Pack 3
TikiWiki-3.1
Apache HTTP Server 2.2
MySQL RDBMS 5.3.1
The resulting installation will have one TikiWiki code-base (php, smary, javascript, etc.) and three distinct MySQL databases (housed under one MySQL relational database management system). TikiWiki’s installer program will create additional directories for each sub-domain, that would not ordinarily be seen after installing a single TikiWiki application.
Create a directory in a location outside of Apache’s root directory.
In XAMPP, Apache serves up files out of the “htdocs†directory for example: C:\xampp\htdocs. On your machine Apache may serve files out of “www†or “public_htmlâ€.
If you are not sure of what your root directory is, locate the httpd.conf file under the apache installation, and search for the following section…
In this document, I created a directory called subdomains (name it what you like) as follows…
“C:\subdomainsâ€
1.1.2. Unzip (or decompress) the TikiWiki-3.1.zip file.
In this example, I rename TikiWiki-3.1 to "taf" - the name of my application - so I end up with “C:\subdomains\tafâ€
You will serve-up TikiWiki out of this directory“C:\subdomainsâ€, rather than Apache’s root directory.
1.1.3. Locate and create a backup of Apache’s “httpd.conf†file.
In an XAMPP install, it can be found here:
C\xampp\apache\conf\httpd.conf
1.1.4. Modify the “httpd.conf†file not the backup as described below…
1.1.5. Locate the “hosts†file on your Windows XP machine and add your subdomains.
It can usually be found at:
C:\WINDOWS\system32\drivers\etc\hosts
The host file will probably already contain a definition for “localhostâ€. Simply add your subdomain names immediately after it, separating each with one space “ “. Here, I have chosen three subdomain names prefixed to “localhostâ€, with a dot “.†in between…
127.0.0.1 localhost demo.localhost test.localhost pilot.localhost
1.1.6. Locate the “httpd-vhosts.conf†file, in the “extra†subdirectory at the following location.
C:\xampp\apache\conf\extra\httpd-vhosts.conf
If you do not have this file, you can probably create the same definitions within the “httpd.conf†file, under the section for Virtual Hosts.
1.1.7. Define your virtual hosts as follows...
NameVirtualHost * <VirtualHost *> ServerName pilot DocumentRoot "C:/subdomains/taf" </VirtualHost> <VirtualHost *> ServerName demo DocumentRoot "C:/subdomains/taf" </VirtualHost> <VirtualHost *> ServerName test DocumentRoot "C:/subdomains/taf" </VirtualHost> # It is very important to get the syntax correct here. # # Put “NameVirtualHost *†at the top and for each of your subdomains put… # # <VirtualHost *> # ServerName subdomain1 # DocumentRoot “C:/path/to/your/subdomain/directory†# </VirtualHost> # # Of course, “subdomain†should be replaces with one of your subdomain names, # and the Document root should match what you created in the first step. # Note the direction of the slashes “/â€
1.1.8. Restart your Apache web server, after you have saved the changes to httpd.conf, hosts, and (possibly) httpd-vhosts.conf.
You are probably running it as a service on Windows XP, and you can restart it by doing the following: Start > Run > “services.msc†> OK > right-click Apache 2.2 --> select “Restartâ€
1.1.9. Create a local.php file for your TikiWiki-3.1/db directory.
In your TikiWiki install directory in this example, I renamed it “taf†and it resides in a directory I named “subdomainsâ€, locate the “db†directory…
C:\subdomains\taf\db
In the db directory, there may be a file named “local.phpâ€. If so, open it for modification. If not, then created a file by that name and enter the following…
<?php $db_tiki='mysqli'; $dbversion_tiki='3.0'; $host_tiki='localhost'; $user_tiki = 'root'; $pass_tiki = 'YourMySQLRootPassword'; if ($_SERVER["HTTP_HOST"] == "demo" || $_SERVER["HTTP_HOST"] == "www.demo") { $tikidomain = "demo.localhost"; $dbs_tiki = "demo"; } elseif ($_SERVER["HTTP_HOST"] == "test" || $_SERVER["HTTP_HOST"] == "www.test") { $tikidomain = "test.localhost"; $dbs_tiki = "test"; } elseif ($_SERVER["HTTP_HOST"] == "pilot" || $_SERVER["HTTP_HOST"] == "www.pilot") { $tikidomain = "pilot.localhost"; $dbs_tiki = "pilot"; } ?>
For a breakdown...
1.1.10. In the “db†directory of your TikiWiki installation, create a new directory named after each of your subdomains.
In my example…
C:\subdomains\taf\db\demo.localhost
C:\subdomains\taf\db\test.localhost
C:\subdomains\taf\db\pilot.localhost
[Remember – “taf†is merely what I renamed my one-and-only TikiWiki-3.1 installation ]
1.1.11. In each of these directories, create a local.php file for each of your subdomains and corresponding databases…
1.1.12. Start the installer for your first domain, by entering "http://<first_subdomain>.localhost/tiki-install.php" in the address bar.
Here I type in http://demo.localhost/tiki-install.php. In my example, “demo†was the name of one of my subdomains. The following screen should be displayed upon entering the installer address...
This is important!
If things have gone well, you should see references to “MultiTiki†displayed in the box on the left-hand side of the browser.
Since I typed in the subdomain for demo, the “demo.localhost†is bolded where it says “DB OKâ€. This indicates that the install is targeted for the database defined for the “demo†subdomain. The installer will create several subdirectories for each subdomain, within your original TikiWiki installation directory or “taf†in my case. Run through these same install steps for each of your subdomains. Make sure that the given subdomain is “bolded†when doing the install for it.
Do NOT lock the installer until after you have run it for your LAST subdomain.
On the last screen of the installer, you will be given the chance to enter your tikiwiki site with or without locking the installer. Choose NOT to lock the installer, until your have installed the tiki for your last subdomain.
If you mistakenly choose to lock the installer, merely delete the "lock" file found under the "db" directory of your MultiTiki code-base, and continue installing tiki for your remaining subdomains.
1.1.13. Other Procedures for Installing Multiple TikiWiki Instances
- TRIM - TikiWiki Remote Instance Manager
- MultiTiki 1.9
- MultiTiki Akira
- http://tikiwiki.org/RecipeMultiTiki
- Manual Installation - includes a description on how to set up MultiTiki in sudomains or subdirectories