web commit from 66.118.98.137:
[ikiwiki] / doc / setup.mdwn
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.
4
5 1. [[Install]] ikiwiki.
6
7                 apt-get install ikiwiki # soon
8
9    Ikiwiki requires [[MarkDown]] be installed, and also uses the following
10    perl modules: `CGI::Session` `CGI::FormBuilder` `HTML::Template`
11
12 2. Create the subversion repository for your wiki.
13
14                 svnadmin create /svn/wikirepo
15                 svn mkdir file:///svn/wikirepo/trunk -m create
16
17 3. Check out the repository to make the working copy that ikiwiki will use.
18
19                 svn co file:///svn/wikirepo/trunk ~/wikiwc
20
21 4. Create some files and add them into subversion.
22
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
27
28 5. Build your wiki for the first time.
29
30                 ikiwiki --verbose ~/wikiwc/ /usr/lib/ikiwiki/templates ~/public_html/wiki/ --url=http://host/~you/wiki/
31
32    Replace the url with the right url to your wiki. You should now
33    be able to visit the url and see your page that you created earlier.
34
35 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
36    the wiki. You can play around with other ikiwiki parameters such as
37    --wikiname too. Get conformatble with its command line.
38
39 7. Set up a Subversion [[post-commit]] hook to automatically rebuild your
40    wiki when you commit to it.
41
42                 ikiwiki ~/wikiwc/ ~/public_html/wiki/ \
43                         --url=http://host/~you/wiki/ --wrapper
44                 mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit
45
46 8. Set up a [[CGI]] to allow editing the wiki from the web.
47
48                 ikiwiki ~/wikiwc/ ~/public_html/wiki/ \
49                         --url=http://host/~you/wiki/ --wrapper --cgi
50                 chmod 6755 ikiwiki-wrap
51                 mv wrapper ~/public_html/wiki/ikiwki.cgi
52
53    Note that this assumes that your web server will run CGI scripts from
54    your public_html directory. You might need to put it somewhere else
55    depending on your web server configuration.
56
57 9. Add links to the CGI to all the pages in your wiki, and update your
58    post-commit hook to add such links when updating the wiki in the
59    future. Note the use of the [[WrapperParamsTrick]].
60
61                 ikiwiki $(/svn/wikirepo/hooks/post-commit --params) \
62                         --cgiurl=http://host/~you/wiki/ikiwiki.cgi --wrapper
63                 mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit
64                 ikiwiki $(/svn/wikirepo/hooks/post-commit --params) --rebuild
65
66    Be sure to change the cgiurl to the actual url to the wiki.cgi you
67    installed in step 9.
68
69 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:
70
71                 --historyurl='http://svn.host/trunk/doc/[[]]?root=wiki'
72
73 11. Enjoy your new wiki!