History: InstallVirtualHosting
Preview of version: 7
This page documents how to setup multiple Tiki sites with virtual hosting on Apache, using a single copy of the Tiki code.
In this example let's host 4 domains:
- feu.org is a community website
- localis.org is a developers website
- cynt.org is a personal website
- tikiwiki.org is a free software development community
Setup 4 separate databases in the normal fashion.
Edit Apache virtualhost settings (I stripped rewrite rules stuff that you can find elsewhere). where :
IP is your server IP or * if you use the ))NameVirtualHost(( directive
DOMAIN is your domain name (feu.org for example)
DOCROOT is where you have put your tikiwiki source tree (/usr/local/tikiwiki for example)
Order allow,deny Allow from all # put one block like that per domain to host ServerName DOMAIN ServerAlias www.DOMAIN DocumentRoot DOCROOT ErrorLog /var/log/apache/DOMAIN-error_log Customlog /var/log/apache/DOMAIN-access_log combined php_flag magic_quotes_gpc Off php_value "include_path" ".:lib:lib/pear:/usr/share/pear" order deny,allow deny from all order deny,allow deny from all
Then create the required directories. The best way to do this is to run the setup.sh command with extra parameters, like this:
setup.sh www-data mose 02775 tiki_feu tiki_localis tiki_cynt tiki_org
Alternatively, you can create the required directories manually like this:
mkdir templates_c/feu mkdir templates_c/localis mkdir templates_c/cynt mkdir templates_c/tiki mkdir modules/cache/feu mkdir modules/cache/localis mkdir modules/cache/cynt mkdir modules/cache/tiki chown -R www-data:mose template_c modules/cache
edit file /usr/local/tikiwiki/db/local.php (there are some commented tips in file db/tiki-db.php) and put something like that (adapt it to your context):
Now you are ready to test it (you did restart Apache, right?)
For my own convenience I also setup a directory local/ with one subdir for each domain for disk storage of contents (set in admin panels).
Templates are common, one theme per site is maybe the right solution.
Any suggestions or corrections to this page are welcome !