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.
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. Or you might copy the
22    files from /usr/share/ikiwiki/basewiki and check those in to get a
23    head start on creating your wiki.
24
25                 echo "Welcome to my empty wiki." > ~/wikiwc/index.mdwn
26                 echo "Feel free to edit this page" > ~/wikiwc/sandbox.mdwn
27                 svn add ~/wikiwc/*.mdwn
28                 svn commit ~/wikiwc -m add
29
30 5. Build your wiki for the first time.
31
32                 ikiwiki --verbose ~/wikiwc/ \
33                   /usr/share/ikiwiki/templates ~/public_html/wiki/ \
34                   --url=http://host/~you/wiki/
35
36    Replace the url with the right url to your wiki. You should now
37    be able to visit the url and see your page that you created earlier.
38
39 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
40    the wiki. You can play around with other ikiwiki parameters such as
41    `--wikiname` and `--rebuild` too. Get confortable with its command line (see [[usage]]).
42
43 7. By now you should be getting tired of typing in all the command line
44    options each time you change something in your wiki's setup. And it's
45    also getting old to have to manualy rebuild the wiki each time you
46    change a file. Time to introduce setup files. 
47    
48    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
49    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. 
50    
51    Most of the options, like `wikiname` in the setup file are the same as
52    ikiwiki's command line options (documented in [[usage]]. `srcdir`,
53    `templatedir` and `destdir` are the three directories you specify when
54    running ikiwiki by hand. `svnrepo` is the path to your subversion 
55    repository. Make sure that all of these are pointing to the right
56    directories, and read through and configure the rest of the file to your
57    liking.
58
59    Note that the default file has a block to configure a svn wrapper. This
60    sets up a [[post-commit]] hook to update the wiki.
61
62    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
63    will set everything up and update your wiki.
64
65 8. Set up [[CGI]] to allow editing the wiki from the web.
66
67    Just edit ikiwiki.setup, uncomment the block for the cgi wrapper, make
68    sure the filename for the cgi wrapper is ok, run 
69    `ikiwiki --setup ikiwiki.setup`, and you're done!
70
71 9. Add [[PageHistory]] links to the top of pages. This requires you to have
72    setup [[ViewCVS]] or something similar to access your [[Subversion]]
73    repository.  The `historyurl` setting makes ikiwiki add the links, and 
74    in that url, "[[]]" is replaced with the name of the file to view. So
75    edit ikiwiki.setup and set `historyurl` to something like this:
76
77         `http://svn.host/trunk/[[]]?root=wiki`
78    
79    Then run `ikiwiki --setup ikiwiki.setup` again.
80
81 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]]