Multitiki Akira | ||||||||||
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: Copy to clipboard
Please be careful with the php_value settings. Don't use these unless you know what they are doing. Restart your webserver. Copy to clipboard
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. Copy to clipboard
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. Copy to clipboard
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. Copy to clipboard 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. -Akira Related pages
|