In my example I am using Red Hat 7.3, apache 1.3.27-4, php-4.1.2-7.36, mysql-3.23.58-1.73.
The key to this example is that I want multiple sites but only under one hostname.
First setup your databases. I have chosen to create a separate mysql user and password for each database. You can do this or have a common user/password. If you have a common user/password you will need to change the code for local.php below. Make sure you follow all the steps for creating the databases as outlined in the INSTALL file. Also outlined here: RecipeMultiTiki. Don't forget to restart mysql.
I plan to put my single tikiwiki install in /var/www/tikiwiki/tikiwiki. Knowing this I setup my httpd.conf. I am going to use three subdirectories under my one hostname using aliases. Here is what one looks like, repeat however many times you want changing only the Alias line:
Alias /tiki-test1 "/var/www/tikiwiki/tikiwiki"
Please be careful with the php_value settings. Don't use these unless you know what they are doing.
Restart your webserver.
# service httpd restart
Get a distribution of Tikiwiki from sourceforge.net. Unpack it and place it where you want, creating directories if you haven't already done so.
# tar -xzvf tikiwiki-1.8.1.tar.gz # mkdir /var/www/tikiwiki # mv tikiwiki-1.8.1 /var/www/tikiwiki/tikiwiki # ln -s tikiwiki/ tikiwiki-1.8.1 (I do this so I can quickly see what version I currently have installed)
We need to run setup.sh to setup the files and directories for tiki as well as for the multiple sites. Replace tiki-test1, tiki-test2 and tiki-test3 with the alias names you used above in httpd.conf.
# ./setup.sh apache apache 02755 tiki-test1 tiki-test2 tiki-test3
Now we want to edit db/local.php. The custom php below does what I want. It extracts the web path from the variable $_SERVER['SCRIPT_URL']. For each site you will need a "case" stanza. The case stanza should include database user/pass/name information as well as the tikidomain variable which we chose above when running setup.sh. If you want to have one mysql user/pass for all sites you would move the $user_tiki and $pass_tiki of the switch section, placing it just below $host_tiki.
I HIGHLY recommend making local.php read-only for user apache. Should you follow these steps later on for a new site and use the tiki-install.php web script to create a new database it WILL overwrite local.php.
If you are going to use the remember me feature you will also want to fill out these fields: Remember me domain, Remember me path.
If you have any questions or suggestions please leave them in the comments of this page.