This Kwiki runs under the ?WN Webserver http:/docs/wn/manual.html. Here you will find out, how this works.
Look also at ?KwikiNotOnApache to see why one would do this and at ?FhsKwiki about some experimental code.
Authentication
Kwiki needs the webserver to be able to restrict access to one (1) file via authentication. I guess there are only a small number of Webserver which can do this, of course Apache can, but WN only can do authentication based on directories.
So the basic trick is, to move the admin.cgi
of Kwiki to a subdirectory (called /admin/
here) and restrict access to this directory. admin.cgi
calls are redirected to this directory. The admin.cgi
accesses the original database, templates, etc. via symbolic links to the original places.
here is the output of ls -l
of the normal instalation directory, showing the additional /admin/
" directory, and a modified admin.cgi
:
drwxr-sr-x 2 root root 320 Sep 16 00:44 admin -rwxr-xr-x 1 root root 316 Sep 16 16:13 admin.cgi -rwxr-xr-x 1 root www-data 103 Sep 5 14:36 blog.cgi -rw-rw-rw- 1 root www-data 1304 Sep 9 11:09 config.yaml drwxr-xr-x 2 root www-data 144 Sep 5 14:38 css drwxrwxrwx 2 root www-data 944 Sep 16 16:15 database -rw-r--r-- 1 root www-data 394 Sep 16 00:38 index.cache -rwxr-xr-x 1 root www-data 91 Sep 5 14:36 index.cgi -rw-r--r-- 1 root www-data 127 Sep 16 00:38 index.wn drwxr-xr-x 2 root www-data 224 Sep 5 14:38 javascript -rwxr-xr-x 1 root www-data 91 Sep 5 14:36 kwiki.cgi drwxrwsrwx 8 root www-data 200 Sep 16 16:01 metabase -rwxr-xr-x 1 root www-data 98 Sep 5 14:36 pages.cgi drwxr-xr-x 2 root www-data 536 Sep 5 14:38 template
And here the contents of the /admin/
directoy. The real admin.cgi
is copied here:
-rwxr-xr-x 1 root www-data 139 Sep 5 14:36 admin.cgi lrwxrwxrwx 1 root root 14 Sep 16 00:36 config.yaml -> ../config.yaml lrwxrwxrwx 1 root root 6 Sep 16 00:36 css -> ../css lrwxrwxrwx 1 root root 11 Sep 16 00:36 database -> ../database -rw-r--r-- 1 root www-data 529 Sep 16 00:37 index.cache -rw-r--r-- 1 root www-data 299 Sep 16 00:37 index.wn lrwxrwxrwx 1 root root 13 Sep 16 00:36 javascript -> ../javascript lrwxrwxrwx 1 root root 11 Sep 16 00:36 metabase -> ../metabase lrwxrwxrwx 1 root root 11 Sep 16 00:36 template -> ../template -rw-r--r-- 1 root root 39 Sep 16 00:44 wnpasswd
And at last, the modified admin.cgi
in the main directory:
#!/bin/sh echo "\ Content-type: text/html Location: http://www.magma.com.ni/im2000/admin/admin.cgi?$QUERY_STRING <HTML> <HEAD><TITLE>Wiki Administration</title></head> <BODY> <H1>Please go to the ...</h1> <A HREF="admin/admin.cgi?$QUERY_STRING">administration directory</a> of this KWiki </body></html> "
This makes for a redirection to the real admin.cgi
located in the /admin/
subdirectory. There might be Browsers which do not understand the redirection, so the cgi also creates a page, showing a link to the real admin.cgi
to click on.
WN Configuration
index.wn
in the main directory:
Default-Attributes=cgi Default-Document=index.cgi File=admin.cgi File=blog.cgi File=index.cgi File=kwiki.cgi File=pages.cgi
index.wn
in the admin directory:
Default-Document=admin.cgi Authorization-Module=~/cgi-bin/wn/wnauth wnpasswd Authorization-Realm=Wiki@magma.com.ni Authorization-Type=basic File=admin.cgi File=blog.cgi Redirect=../blog.cgi File=index.cgi Redirect=../ File=kwiki.cgi Redirect=../kwiki.cgi File=pages.cgi Redirect=../pages.cgi
Kwiki Installation
I experienced some trouble when activating the features of Kwiki, here are the tips to avoid them:
- Don't use any TAB Characters in the
config.yaml
file! - The following directories had to be created by hand
*
metabase/blog
metabase/private
metabase/public
metabase/rcs
- I gave this directories the following owner:
chown root.www-data metabase/*
- and permissions:
chmod u=rwx,g=srwx metabase/*
Issues
The given configuration does not allow to see slides from within the admin directory.
?CategoryWebservices