]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
* Add support for using git instead of subversion as the RCS backend,
[ikiwiki.git] / doc / setup.mdwn
1 So you want to set up your own wiki using ikiwiki? This tutorial will walk
2 you through setting up a wiki that is stored in [[Subversion]] or [[Git]],
3 and that has optional support for commits from the web.
4
5 1. [[Install]] ikiwiki. See [[download]] for where to get it.
6
7 2. Create the master rcs repository for your wiki.
8
9                 # Subversion
10                 svnadmin create /svn/wikirepo
11                 svn mkdir file:///svn/wikirepo/trunk -m create
12
13                 # Git
14                 mkdir /git/wikirepo
15                 cd /git/wikirepo
16                 git init-db
17
18 3. Check out the repository to make the working copy that ikiwiki will use.
19
20                 # Subversion
21                 svn co file:///svn/wikirepo/trunk ~/wikiwc
22
23                 # Git
24                 git clone /git/wikirepo ~/wikiwc
25
26 4. Build your wiki for the first time.
27
28                 ikiwiki --verbose ~/wikiwc/ ~/public_html/wiki/ \
29                         --url=http://host/~you/wiki/
30
31    Replace the url with the real url to your wiki. You should now
32    be able to visit the url and see your wiki.
33
34 5. Customise your wiki. The files in `/usr/share/ikiwiki/basewiki/` are
35    used if you don't have a custom version, so let's start by making a
36    custom version of the wiki's index page:
37
38                 cd ~/wikiwc
39                 cp /usr/share/ikiwiki/basewiki/index.mdwn .
40                 $EDITOR index.mdwn
41
42                 # Subversion
43                 svn add index.mdwn
44                 svn commit -m customised index.mdwn
45
46                 # Git
47                 git add index.mdwn
48                 git commit -m customised index.mdwn
49                 git push origin
50
51    You can also add any files you like from scratch of course.
52
53 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
54    the wiki. You can play around with other ikiwiki parameters such as
55    `--wikiname` and `--rebuild` too. Get comfortable with its command line
56    (see [[usage]]).
57
58 7. By now you should be getting tired of typing in all the command line
59    options each time you change something in your wiki's setup. And it's
60    also getting old to have to manualy rebuild the wiki each time you
61    change a file. Time to introduce setup files. 
62    
63    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
64    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. 
65    
66    Most of the options, like `wikiname` in the setup file are the same as
67    ikiwiki's command line options (documented in [[usage]]. `srcdir` and
68    `destdir` are the two directories you specify when running ikiwiki by
69    hand. `rcsrepo` is the path to your master rcs repository.  Make sure
70    that all of these are pointing to the right directories, and read
71    through and configure the rest of the file to your liking.
72
73    Note that the default file has a block to configure an Rcs wrapper to
74    update the wiki.  You need to uncomment the related block for whatever
75    rcs you use and comment out the other rcs blocks.
76
77    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
78    will set everything up and update your wiki.
79
80 8. Set up [[CGI]] to allow editing the wiki from the web.
81
82    Just edit ikiwiki.setup, uncomment the block for the cgi wrapper, make
83    sure the filename for the cgi wrapper is ok, run 
84    `ikiwiki --setup ikiwiki.setup`, and you're done!
85
86 9. Add [[PageHistory]] links to the top of pages. This requires you to have
87    setup a repository browser.  For Subversion, you may use [[ViewCVS]] or
88    something similar to access your [[Subversion]] repository.  For Git,
89    [[Gitweb]] can be used.
90    
91    The `historyurl` setting makes ikiwiki add the links, and in that url,
92    "\[[file]]" is replaced with the name of the file to view. So edit
93    ikiwiki.setup and set `historyurl` to something like this for
94    Subversion:
95
96         `http://svn.host/trunk/\[[file]]?root=wiki`
97
98    Or this for Git:
99
100         `http://git.host/gitweb.cgi?p=wiki.git;a=history;f=[[file]]`
101    
102    Then run `ikiwiki --setup ikiwiki.setup` again.
103
104 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]]