1 So you want to set up your own wiki using ikiwiki? This turorial will walk
2 you through setting up a wiki that is stored in [[Subversion]] and that has
3 optional support for commits from the web.
5 1. [[Install]] ikiwiki.
7 apt-get install ikiwiki # soon
9 Ikiwiki requires [[MarkDown]] be installed, and also uses the following
10 perl modules: `CGI::Session` `CGI::FormBuilder` `HTML::Template`
12 2. Create the subversion repository for your wiki.
14 svnadmin create /svn/wikirepo
15 svn mkdir file:///svn/wikirepo/trunk -m create
17 3. Check out the repository to make the working copy that ikiwiki will use.
19 svn co file:///svn/wikirepo/trunk ~/wikiwc
21 4. Create some files and add them into subversion.
23 echo "Welcome to my empty wiki." > ~/wikiwc/index.mdwn
24 echo "Feel free to edit this page" > ~/wikiwc/sandbox.mdwn
25 svn add ~/wikiwc/*.mdwn
26 svn commit ~/wikiwc -m add
28 5. Build your wiki for the first time.
30 ikiwiki --verbose ~/wikiwc/ ~/public_html/wiki/ \
31 --url=http://host/~you/wiki/
33 Replace the url with the right url to your wiki. You should now
34 be able to visit the url and see your page that you created earlier.
36 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
37 the wiki. You can play around with other ikiwiki parameters such as
38 --wikiname too. Get conformatble with its command line.
40 7. Set up a Subversion [[post-commit]] hook to automatically rebuild your
41 wiki when you commit to it.
43 ikiwiki ~/wikiwc/ ~/public_html/wiki/ \
44 --url=http://host/~you/wiki/ --wrapper
45 mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit
47 8. Set up a [[CGI]] to allow editing the wiki from the web.
49 ikiwiki ~/wikiwc/ ~/public_html/wiki/ \
50 --url=http://host/~you/wiki/ --wrapper --cgi
51 chmod 6755 ikiwiki-wrap
52 mv wrapper ~/public_html/wiki/ikiwki.cgi
54 Note that this assumes that your web server will run CGI scripts from
55 your public_html directory. You might need to put it somewhere else
56 depending on your web server configuration.
58 9. Add links to the CGI to all the pages in your wiki, and update your
59 post-commit hook to add such links when updating the wiki in the
60 future. Note the use of the [[WrapperParamsTrick]].
62 ikiwiki $(/svn/wikirepo/hooks/post-commit --params) \
63 --cgiurl=http://host/~you/wiki/ikiwiki.cgi --wrapper
64 mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit
65 ikiwiki $(/svn/wikirepo/hooks/post-commit --params) --rebuild
67 Be sure to change the cgiurl to the actual url to the wiki.cgi you
70 10. Add [[PageHistory]] links to the top of pages. This requires you to have setup [[ViewCVS]] or something similar to access your [[Subversion]] repository. The --historyurl parameter makes ikiwiki add the links, and in that url, "[[]]" is replaced with the name of the file to view. So repeat step 9 to rebuild the wiki post commit wrapper and wiki, adding a historyurl something like this one:
72 --historyurl='http://svn.host/trunk/doc/[[]]?root=wiki'
74 11. Enjoy your new wiki!