Loading...
 
Skip to main content

History: InstallVirtualHosting

Preview of version: 3

I just modifed the source for virtual hosting enabled for all the tikis I need. Here is how I proceeded (waiting for more writing efforts for a decent documentation).

let's host 3 domains
feu.org is a community website
localis.org is a developpers website
cynt.org is a personnal website
tikiwiki.org is a free software development community

I setup 4 databases, dumping content from db/tiki.sql and db/tiki_1.6-1.7.sql
call them tiki_feu, ))tiki_localis((, tiki_cynt and tiki_org

now here is my virtualhost settings (I striped 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
<Directory DOCROOT> Order allow,deny Allow from all </Directory> # put one block like that per domain to host <VirtualHost IP> 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" <FilesMatch "\.(bak|inc|lib|sh|sql|tpl)$"> order deny,allow deny from all </FilesMatch> <FilesMatch "^\.#"> order deny,allow deny from all </FilesMatch> </VirtualHost>


then I create some more cache directories:
(that operation can be conducted by running
setup_virtual.sh, just think to edit that file to
hardcode domain names)

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


Now setup the conf for tikiwikis:
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
<?php $host_tiki = 'localhost'; $user_tiki = 'tiki'; $pass_tiki = 'tiki'; if (($_SERVER["SERVER_NAME"] == "localis.org") or ($_SERVER["SERVER_NAME"] == "www.localis.org")) { $dbs_tiki = 'tiki_localis'; $tikidomain = 'localis'; } elseif .... { .... } else { # do you have a default setting $dbs_tiki = 'tiki_feu'; $tikidomain = 'feu'; } ?>


Here is done. 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.

Here is it. any suggestion is welcome, and bugfixes are enjoyed !

History

Information Version
Baraka Kinywa 17
View
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