Loading...
 
Skip to main content

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

Create Tiki databases

Setup 4 separate databases in the normal fashion.

Setup Virtual Hosting in Apache

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)

Copy to clipboard
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

Create directories

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:

Copy to clipboard
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 database configuration

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):

Copy to clipboard


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 !

History

Information Version
Xavier de Pedro moved back from doc.tw.o 16
View
Marc Laporte fix link 15
View
mlpvolt 14
View
Mose 13
View
Xavier de Pedro some info added as a newbie friend got stack due to lack of that information while starting his first ever Tiki installation...(and he ended up following this manual first) 12
View
Marc Laporte inverted ''user'' and ''group'' 11
View
Jeremy Butler Removed < ? php from code listing because it was confusing Mozilla/IE. Applied some doc formatting. 10
View
Stephan Borg 9
View
Stephan Borg 8
View
van_woods 7
View
Dennis Heltzel 5
View
Dennis Heltzel 4
View
Mose updated with SERVER_NAME rather than HTTP_HOST 3
View
Mose 2
View