document setup files
[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 confortable with its command line.
40
41 7. By now you should be getting tired of typing in all the command line
42    options each time you change something in your wiki's setup. And it's
43    also getting old to have to manualy rebuild the wiki each time you
44    change a file. Time to introduce setup files. 
45    
46    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
47    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. 
48    
49    Most of the options, like `wikiname` in the setup file are the same as
50    ikiwiki's command line options (documented in [[usage]]. `srcdir`,
51    `templatedir` and `destdir` are the three directories you specify when
52    running ikiwiki by hand. `svnrepo` is the path to your subversion 
53    repository. Make sure that all of these are pointing to the right
54    directories, and read through and configure the rest of the file to your
55    liking.
56
57    Note that the default file will enable a [[post-commit]] hook to
58    update the wiki, but has cgi support turned off.
59
60    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it will
61    generate the subversion [[post-commit]] hook and update your wiki.
62
63 8. Set up [[CGI]] to allow editing the wiki from the web.
64
65    Just edit ikiwiki.setup, change cgiwrapper to 1, and optioanlly anonok
66    to 1, run `ikiwiki --setup ikiwiki.setup`, and you're done!
67
68 9. Add [[PageHistory]] links to the top of pages. This requires you to have
69    setup [[ViewCVS]] or something similar to access your [[Subversion]]
70    repository.  The `historyurl` setting makes ikiwiki add the links, and 
71    in that url, "[[]]" is replaced with the name of the file to view. So
72    edit ikiwiki.setup and set `historyurl` to something like this:
73
74         `http://svn.host/trunk/[[]]?root=wiki`
75    
76    Then run `ikiwiki --setup ikiwiki.setup` again.
77
78 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]]