How to Host Multiple TikiWikis on a Single Fedora Core System.
by George Geller
Introduction
General instructions for installing multiple tikis on a single server are at InstallVirtualHosting. And instructions for installing multiple tikis without virtual hosting (i.e., using subdirectories), are at AkiraMultiTiki.
This documentation is for Tiki, version 1.10. It should work for versions back to at least 1.8. For Tiki version 1.9 and later there is also another approach documented at MultiTiki19.
Here I show one way to install multiple tikis on a Fedora Core Linux server
when you have root access. I assume that you already have apache, php
and mysql all working on your system. If you installed the correct
rpms and didn't change the configuration files too much,
these programs should be working. I've had success with this approach
on Fedora Core 3, ))RedHat8,RedHat(( 9 and Yellow Dog 3.0.
In this example I go through the steps to create threee working tikis on
my machine and give a few pointers in the process. I will be
specific, rather than general, concrete, rather than abstract. If
your setup is different you'll have to adapt the instructions.
I illustrate how to set up three tikis: public.wikiplanet.com,
member.wikiplanet.com and staff.wikiplanet.com.
MySQL Setup
Each tiki instance will need a separate database in MySql Tiki also
needs a ))MySql(( user that has the correct permissions to manipulate the
databases. The names of the databases don't matter to ))MySql((, but I
have adopted a convention where I always use a prefix of tiki_ for the
database name. So for my three tikis, the corresponding databases
will be: tiki_public, tiki_member and tiki_staff. I create a single
))MySql(( user, 'tiki', that will have access to all tiki databases.
The commands I issue as root are:
Copy to clipboard # mysqladmin -uroot -p create tiki_public
# mysqladmin -uroot -p create tiki_member
# mysqladmin -uroot -p create tiki_staff
Then I run ))MySql(( to set up the 'tiki' user with the correct permissionsCopy to clipboard # mysql -uroot -p
mysql> USE mysql;
mysql> GRANT USAGE ON * . * TO "tiki"@"localhost" IDENTIFIED BY "password";
mysql> GRANT ALL PRIVILEGES ON `tiki_public` . * TO "tiki"@"localhost";
mysql> REVOKE GRANT OPTION ON `tiki_public` . * FROM "tiki"@"localhost";
mysql> GRANT ALL PRIVILEGES ON `tiki_member` . * TO "tiki"@"localhost";
mysql> REVOKE GRANT OPTION ON `tiki_member` . * FROM "tiki"@"localhost";
mysql> GRANT ALL PRIVILEGES ON `tiki_staff` . * TO "tiki"@"localhost";
mysql> REVOKE GRANT OPTION ON `tiki_staff` . * FROM "tiki"@"localhost";
mysql> exit
-
Apache Configuration
Next I edit the Apache web server configuration /etc/httpd/conf/httpd.conf so that apache will know where to look for the tikis.
VirtualHost
Further down, find the line with ))NameVirtualHost(( and change it to:
))NameVirtualHost(( *:80
At the end of the httpd.conf, add the line:
Copy to clipboard Include conf.d/*.vh
Create a .vh file in /etc/httpd/conf.d/ for each of your virtual hosts.
/etc/httpd/conf.d/public.wikiplanet.com.vh contains:
Copy to clipboard <VirtualHost *:80>
ServerAdmin webmaster@wikiplanet.com
DocumentRoot /var/www/public.wikiplanet.com
ServerName public.wikiplanet.com
ErrorLog logs/public.wikiplanet.com-error_log
CustomLog logs/public.wikiplanet.com-access_log common
</VirtualHost>
/etc/httpd/conf.d/member.wikiplanet.com.vh contains:
Copy to clipboard <VirtualHost *:80>
ServerAdmin webmaster@wikiplanet.com
DocumentRoot /var/www/member.wikiplanet.com
ServerName member.wikiplanet.com
ErrorLog logs/member.wikiplanet.com-error_log
CustomLog logs/member.wikiplanet.com-access_log common
</VirtualHost>
/etc/httpd/conf.d/staff.wikiplanet.com.vh contains:
Copy to clipboard <VirtualHost *:80>
ServerAdmin webmaster@wikiplanet.com
DocumentRoot /var/www/staff.wikiplanet.com
ServerName staff.wikiplanet.com
ErrorLog logs/staff.wikiplanet.com-error_log
CustomLog logs/staff.wikiplanet.com-access_log common
</VirtualHost>
Restart your web server.
Copy to clipboard # apachectl graceful
Don't worry about the warnings that the directories don't exist, we're going to make them next.
-
Install Tikiwiki
Install Distribution
Get a distribution of Tikiwiki from sourceforge.net. Put it in /var/www/tikiwiki and make the soft links.
Copy to clipboard # cd /www
# ln -s tikiwiki public.wikiplanet.com
# ln -s tikiwiki member.wikiplanet.com
# ln -s tikiwiki staff.wikiplanet.com
Add Database Selection Code
Now you need to edit the code in db/local.php.
Copy to clipboard # cd /www/tikiwiki/db
Edit local.php. Mine reads:
Copy to clipboard <?php
$host_tiki="localhost";
$user_tiki="tiki";
$pass_tiki="secret";
$db_tiki = 'mysql';
$dbversion_tiki="1.8";
if ($_SERVER["HTTP_HOST"] == "public.wikiplanet.com") {
$dbs_tiki = "tiki_public";
$tikidomain = "public.wikiplanet.com";
} elseif ($_SERVER["HTTP_HOST"] == "member.wikiplanet.com") {
$dbs_tiki = "tiki_member";
$tikidomain = "member.wikiplanet.com";
} elseif ($_SERVER["HTTP_HOST"] == "staff.wikiplanet.com") {
$dbs_tiki = "tiki_staff";
$tikidomain = "staff.wikiplanet.com";
} else {
// default case, your choice is to block or open to a default domain
}
?>
Set Up files
Set up the files and directories for tiki:
Copy to clipboard # cd /www/tikiwiki
# ./setup.sh apache apache 02755 public.wikiplanet.com member.wikiplanet.com staff.wikiplanet.com
# chown apache:apache *.php .
Run Tiki Install Script
Next we need to run the Tiki install script for the new wikis with a web browser. You must have dns working correctly, or you can edit /etc/hosts. In my case dns works, so I point Mozilla to: http://public.wikiplanet.com/tiki-install.php and run the install script. Do not choose to "remove" tiki-install.php yet! Repeat the procedure for the other two tiki's: member and staff. In the final case, "remove" the install script.
Admin TikiWikis
That's all. Login to the tikis as admin and configure them.
Notes
Since the tikis share the same file tree there are some limitations to this approach.
Admin and users with the same names in different tikis may end up editing the same style sheets.
Microsoft's Internet Explorer browser can't be told where to look for favicon; it always look in your document root. So all your sites hosted this way have to have the same favicon, or the web server has to change the favicon.ico request. See WikiShortcutIcon for use of shortcut icons.
-
See RecipeMultiTiki2 for how to add new Tikis to this setup.
Feel free to edit this page or add comments. - George Geller
|