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