no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | people:priestdo:tips:multihome_dokuwiki_hacks [2008/02/21 16:07] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Multihome Dokuwiki Hacks ====== | ||
+ | |||
+ | I use the article by Lukas Ruf on setting up dokuwiki on a mutihomed web server to allow multiple separate wikis to run on one machine. | ||
+ | |||
+ | These are a few things I have done in addition to the suggestions in the article. | ||
+ | |||
+ | |||
+ | ===== Create a default tar file or script ===== | ||
+ | |||
+ | You are going to need more wikis than you think. | ||
+ | |||
+ | Or if you don't like that idea, here is a slightly more generic version of the script provided on Lukas Ruf's site: | ||
+ | |||
+ | < | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | # my modification of the script by Lukas Ruf for | ||
+ | # setting up new virtual dokuwikis | ||
+ | # Greg Priest-Dorman 2008-01 | ||
+ | # | ||
+ | ##################################################### | ||
+ | # Change these locations to suit your installation | ||
+ | # dokuwiki root directory | ||
+ | DRD=/ | ||
+ | # dokuwiki data directory | ||
+ | DDD=/ | ||
+ | # an existing wiki directory to copy the wiki syntax pages from | ||
+ | OLD=" | ||
+ | # user:group of web server | ||
+ | WUG=" | ||
+ | if [ $# -lt 1 ] | ||
+ | then | ||
+ | echo "Usage $0 NEW_DIR_NAME" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " " | ||
+ | else | ||
+ | NEW=$1 | ||
+ | if [ -e $DDD/$NEW -o -e $DRD/$NEW ] | ||
+ | then | ||
+ | echo "$NEW exists, exiting" | ||
+ | exit 1 | ||
+ | else | ||
+ | umask 027 | ||
+ | mkdir -p -m 2700 $DDD/ | ||
+ | touch $DDD/ | ||
+ | |||
+ | # | ||
+ | # comment out next 2 lines if you don't want the " | ||
+ | # | ||
+ | cp -r $DDD/ | ||
+ | cp -r $DDD/ | ||
+ | # | ||
+ | # add .htaccess | ||
+ | echo "order allow, | ||
+ | echo "deny from all" >> $DDD/ | ||
+ | |||
+ | # next line needed to get group sticky everyware... | ||
+ | chmod -R g+s $DDD/$NEW | ||
+ | # make sure owner and group are correct as well | ||
+ | chown -R $WUG $DDD/$NEW | ||
+ | # link it in to dokuwiki root | ||
+ | ln -s $DDD/$NEW $DRD/$NEW | ||
+ | echo " | ||
+ | fi | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Default config ===== | ||
+ | |||
+ | If a name gets to the wiki that does not have a conf file associated | ||
+ | with it the user gets access to the defaults in the conf/ | ||
+ | file. In my case they got to my primary wiki space (in ./data) but | ||
+ | bypassed the acl' | ||
+ | |||
+ | < | ||
+ | /* | ||
+ | * set your default wiki configuration with $mydefaulthostconfig | ||
+ | * make sure it exists and is readable as this will get loaded | ||
+ | * if there is not a match. | ||
+ | * | ||
+ | */ | ||
+ | |||
+ | $mydefaulthostconfig = DOKU_INC.' | ||
+ | $myhostname | ||
+ | $myhostconfig = DOKU_INC.' | ||
+ | if (!is_readable($myhostconfig)) { | ||
+ | | ||
+ | } | ||
+ | @include_once($myhostconfig); | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== favicon hack ===== | ||
+ | |||
+ | This time I wanted each virtual to be able to have it's own | ||
+ | favicon.ico file. | ||
+ | |||
+ | I decided that the favicon.ico for each wiki should live in the top | ||
+ | level of each wiki's media directory. | ||
+ | upload favicon.ico files you would need to add ico as a mime type to | ||
+ | the mime.conf file. In my case that was not an issue. | ||
+ | |||
+ | For each template search the php files in the DOKU_TPL directory | ||
+ | (''/ | ||
+ | |||
+ | | ||
+ | |||
+ | and replace them with | ||
+ | |||
+ | | ||
+ | |||
+ | Now put the favicon.ico that you want used in the media directory of | ||
+ | each virtual wiki and that is the one that will be served. | ||
+ | |||
+ | This hack will of course have to be repeated any time the template is | ||
+ | upgraded or changed. | ||
+ | |||