web commit by joey
[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. See [[download]] for where to get it.
6
7    Ikiwiki requires [[MarkDown]] be installed, and also uses the following
8    perl modules: `CGI::Session` `CGI::FormBuilder` (version 3.02.02 or
9    newer) `HTML::Template` `Mail::SendMail` `Time::Duration` `Date::Parse`
10    (libtimedate-perl), `HTML::Scrubber`
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. Build your wiki for the first time.
22
23                 ikiwiki --verbose ~/wikiwc/ ~/public_html/wiki/ \
24                         --url=http://host/~you/wiki/
25
26    Replace the url with the real url to your wiki. You should now
27    be able to visit the url and see your wiki.
28
29 5. Customise your wiki. The files in `/usr/share/ikiwiki/basewiki/` are
30    used if you don't have a custom version, so let's start by making a
31    custom version of the wiki's index page:
32
33                 cp /usr/share/ikiwiki/basewiki/index.mdwn ~/wikiwc
34                 svn add ~/wikiwc/index.mdwn
35                 $EDITOR ~/wikiwc/index.mdwn
36                 svn commit ~/wikiwc/index.mdwn -m customised
37
38    You can also add any files you like from scratch of course.
39
40 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
41    the wiki. You can play around with other ikiwiki parameters such as
42    `--wikiname` and `--rebuild` too. Get comfortable with its command line
43    (see [[usage]]).
44
45 7. By now you should be getting tired of typing in all the command line
46    options each time you change something in your wiki's setup. And it's
47    also getting old to have to manualy rebuild the wiki each time you
48    change a file. Time to introduce setup files. 
49    
50    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
51    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. 
52    
53    Most of the options, like `wikiname` in the setup file are the same as
54    ikiwiki's command line options (documented in [[usage]]. `srcdir`
55    and `destdir` are the two directories you specify when
56    running ikiwiki by hand. `svnrepo` is the path to your subversion 
57    repository. Make sure that all of these are pointing to the right
58    directories, and read through and configure the rest of the file to your
59    liking.
60
61    Note that the default file has a block to configure a svn wrapper. This
62    sets up a [[post-commit]] hook to update the wiki.
63
64    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
65    will set everything up and update your wiki.
66
67 8. Set up [[CGI]] to allow editing the wiki from the web.
68
69    Just edit ikiwiki.setup, uncomment the block for the cgi wrapper, make
70    sure the filename for the cgi wrapper is ok, run 
71    `ikiwiki --setup ikiwiki.setup`, and you're done!
72
73 9. Add [[PageHistory]] links to the top of pages. This requires you to have
74    setup [[ViewCVS]] or something similar to access your [[Subversion]]
75    repository.  The `historyurl` setting makes ikiwiki add the links, and 
76    in that url, "\[[file]]" is replaced with the name of the file to view. So
77    edit ikiwiki.setup and set `historyurl` to something like this:
78
79         `http://svn.host/trunk/\[[file]]?root=wiki`
80    
81    Then run `ikiwiki --setup ikiwiki.setup` again.
82
83 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]]