sort backlinks by page name
[ikiwiki.git] / 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/ \
31                   /usr/lib/ikiwiki/templates ~/public_html/wiki/ \
32                   --url=http://host/~you/wiki/
33
34    Replace the url with the right url to your wiki. You should now
35    be able to visit the url and see your page that you created earlier.
36
37 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
38    the wiki. You can play around with other ikiwiki parameters such as
39    --wikiname too. Get conformatble with its command line.
40
41 7. Set up a Subversion [[post-commit]] hook to automatically rebuild your
42    wiki when you commit to it.
43
44                 ikiwiki ~/wikiwc/ \
45                     /usr/lib/ikiwiki/templates ~/public_html/wiki/ \
46                         --url=http://host/~you/wiki/ --wrapper
47                 mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit
48
49 8. Set up a [[CGI]] to allow editing the wiki from the web.
50
51                 ikiwiki ~/wikiwc/ \
52                     /usr/lib/ikiwiki/templates ~/public_html/wiki/ \
53                         --url=http://host/~you/wiki/ --wrapper --cgi
54                 chmod 6755 ikiwiki-wrap
55                 mv wrapper ~/public_html/wiki/ikiwki.cgi
56
57    Note that this assumes that your web server will run CGI scripts from
58    your public_html directory. You might need to put it somewhere else
59    depending on your web server configuration.
60
61 9. Add links to the CGI to all the pages in your wiki, and update your
62    post-commit hook to add such links when updating the wiki in the
63    future. Note the use of the [[WrapperParamsTrick]].
64
65                 ikiwiki $(/svn/wikirepo/hooks/post-commit --params) \
66                         --cgiurl=http://host/~you/wiki/ikiwiki.cgi --wrapper
67                 mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit
68                 ikiwiki $(/svn/wikirepo/hooks/post-commit --params) --rebuild
69
70    Be sure to change the cgiurl to the actual url to the wiki.cgi you
71    installed in step 9.
72
73 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:
74
75                 --historyurl='http://svn.host/trunk/[[]]?root=wiki'
76
77 11. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]]