Quick notes for DokuWiki

Notes from tonight’s playing with DokuWiki. Initially saved it as a text file, then thought, what the hell, it might benefit somebody.

1. Got DokuWiki. Learned this from my buddy Baron, who I admire and whose recommendations I take seriously.

2. Fired up ami-23b6534a, an Amazon virtual instance with Apache pre-configured.
/var/www/html is the web root directory, fairly common.
use this code snippet to find out user and group that Apache httpd runs under:

< ?php

if(function_exists('posix_geteuid')){
    // use posix to get current uid and gid
    $uid   = posix_geteuid();
    $usr   = posix_getpwuid($uid);
    $user  = $usr['name'];
    $gid   = posix_getegid();
    $grp   = posix_getgrgid($gid);
    $group = $grp['name'];
}else{
    // try to create a file and read it's ids
    $tmp = tempnam ('/tmp', 'check');
    $uid = fileowner($tmp);
    $gid = filegroup($tmp);

    // try to run ls on it
    $out = `ls -l $tmp`;
    $lst = explode(' ',$out);
    $user  = $lst[2];
    $group = $lst[3];
    unlink($tmp);
}

echo "Your PHP process seems to run with the UID $uid ($user) and the GID $gid ($group)\n"; ?>

Or phpinfo, which is a bit too much data.

3. Downloaded DokuWiki and expanded it, and put it under the web root directory.

4. Permission stuff.

chmod 775 conf/
chgrp apache conf/
chgrp apache data/
chmod 775 data/
chmod 775 data/pages/
chgrp apache data/pages/
chmod 775 data/attic/
chgrp apache data/attic/
chgrp apache data/media/
chmod 775 data/media/
chmod 775 data/meta/
chgrp apache data/meta/
chgrp apache data/cache/
chmod 775 data/cache/
chmod 775 data/locks/
chgrp apache data/locks/
chgrp apache data/index/
chmod 775 data/index/
chmod 775 data/tmp/
chgrp apache data/tmp/
mv data /home/myname/
modify conf/local.php to include this line:
$conf['savedir'] = ‘/home/myname/data/’;
mv conf /home/myname/
add preload.php under /var/www/html/inc with this content:

define(’DOKU_CONF’,'/home/myname/conf/’);

To do:

1. a quick once-over of Wiki syntax.
2. Possibly search for transferring from one wiki platform to another?
3. Creating a test page. Shandong comes to mind.

该洗洗睡了。明天再说。记着和老婆一起把外面那个桌子搬到地下室里,记着教孩子中文要耐心!

1 Comment »

  1. The Ji Village News » Quick notes for DokuWiki Dokuwiki Said,

    November 17, 2009 @

    [...] here:  The Ji Village News » Quick notes for DokuWiki By admin | category: dokuwiki | tags: baron, buddy, dokuwiki, from-tonight, how-difficult, [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment