Multitiki version 1.9 | |
|
Multitiki appeared in tiki 1.7, it was one of my first contributions in june 2003. After some time and evolution this special tiki setup is now robust and well-tested. The current documentation talks about the 1.9 multitiki version. There is an alternative proposed by ggeller on RecipeMultiTiki that is more adapted to 1.8 version. Multiki under Windows XP
Following steps only apply to GNU/Linux environment. | |
Simple steps to add one virtual tiki to an existing one | |
|
| |
Setup (perms and dir creation) | |
|
Run setup.sh with an extra parameter that will be the name of your virtual tiki. Either TIKI_VIRTUAL, SERVER_NAME, or HTTP_HOST can be used to detect in which multitiki to go fdepending the apache configuration. Here is what I typed to add http://lir.be test website to my multitiki collection. Copy to clipboard
The script will :
| |
Install (db feeding) | |
|
Re-activate your web-install file if your neutralized it by a chmod. for example Copy to clipboard
Point your browser on http://yourtiki/tiki-install.php (if it doesn't work, try to add "lang=en" to the URL: http://yourtiki/tiki-install.php?lang=en). There should be a new item in the menu on the topleft, indicating the state of the db connection (actually the existence and validity of the local.php file for that virtual). That menu is based on db/virtuals.inc file so you can want to change things manually there for tuning. Clicking on the link activates the virtual web-install page like if it was a lone tiki. Then you can follow the install steps :
| |
Secure (neutralize tiki-install.php) | |
|
The best known way is to change perms on the tiki-install, if you use cvs it won't break all things Copy to clipboard
| |
The fast way (without using tiki-install.php) | |
|
On already setup multitiki, you can perform the required operation with command line. For example in case of the lir.be that we saw above : Copy to clipboard
then copy the local.php from another instance of the multitiki, edit it and change the dbname, user and password accordingly to the above creation.
| |
How it works ? | |
|
Multitiki uses a subdir in each of these directories so each virtual tiki has his own temporary stuff and there is no collision risk. In more than temporary and cache directories, 1.9 adds a subdir in other places that become specific for each virtual
About templates and styles, the virtual tiki uses its subdir by cascading. the subdir can be empty, then the 'root' items (templates or css) are used. Then the non-subdired templates and styles are what is common to all virtual tikis on this system. If there is an equivalent file name in a subdir for a virtual tiki, that local file will be preferred, in same order than in main tiki in case of styled templates. Ok. I lost you. Here is an example :
About how the hell tiki knows what virtual to use, it's located in db/tiki-db.php. That file tests the hostname and attribute it to the tikidomain variable that is the name of the subdirs used. Nothing very complicated. If you have multi-named hosts you can change that code to fit your needs. That's also where can be solved the case of subdirs (rather than virtual domains) by testing on url path. OPTIONAL
To do multitiki according to the subdomain name (www, subdomain1, subdomain2...) whatever the main domain name is, add the following lines to tiki-db.php after line 55. That will select the database
Copy to clipboard
then this line after conditions on HTTP_HOST Copy to clipboard
END MULTITIKI ON SUBDOMAIN ONLY
Note
More
feedback is welcome, feel free to edit that page for adding or changing
Related pages
| |