]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
add news item for ikiwiki 1.30
[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]], [[Git]],
3 [[TLA]] or [[Mercurial]], 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                 # Git requires something be in the repo to start with.
18                 cp /usr/share/ikiwiki/basewiki/index.mdwn .
19                 git add .
20                 git commit -m create -a
21                 # No need to keep files in the master repository; so at this
22                 # stage, you may want to remove all files (except .git) to
23                 # save disk space.
24
25                 # TLA
26                 mkdir /tla
27                 tla make-archive me@localhost--wiki /tla/wikirepo
28                 tla my-id "<me@localhost>"
29
30                 # Mercurial
31                 hg init /hg/wikirepo
32
33 3. Check out the repository to make the working copy that ikiwiki will use.
34
35                 # Subversion
36                 svn co file:///svn/wikirepo/trunk ~/wikiwc
37                  
38                 # Git
39                 # Create a local clone to save disk space and also to
40                 # optimize performance. See git-clone(1).
41                 git clone -l -s /git/wikirepo ~/wikiwc
42
43                 # TLA
44                 mkdir ~/wikiwc
45                 cd ~/wikiwc
46                 tla archive-setup me@localhost--wiki/wiki--0
47                 tla init-tree me@localhost--wiki/wiki--0
48                 # Edit {arch}/=tagging-method and change the precious
49                 # line to add the .ikiwiki directory to the regexp.
50                 tla import
51
52                 # Mercurial
53                 # Mercurial uses a single repo approach, so no need to
54                 # clone anything. Because the following examples
55                 # refer to the ~/wikiwc working copy we symlink it:
56                 ln -s /hg/wikirepo ~/wikiwc
57
58 4. Build your wiki for the first time.
59
60                 ikiwiki --verbose ~/wikiwc/ ~/public_html/wiki/ \
61                         --url=http://host/~you/wiki/
62
63    Replace the url with the real url to your wiki. You should now
64    be able to visit the url and see your wiki.
65
66 5. Customise your wiki. The files in `/usr/share/ikiwiki/basewiki/` are
67    used if you don't have a custom version, so let's start by making a
68    custom version of the wiki's index page:
69
70                 cd ~/wikiwc
71                 cp /usr/share/ikiwiki/basewiki/index.mdwn .
72                 $EDITOR index.mdwn
73                  
74                 # Subversion
75                 svn add index.mdwn
76                 svn commit -m customised index.mdwn
77                  
78                 # Git
79                 git add index.mdwn
80                 git commit -m customised index.mdwn
81                 git push origin
82
83                 # TLA
84                 tla add index.mdwn
85                 tla commit
86
87                 # Mercurial
88                 hg add index.mdwn
89                 hg commit -m customised index.mdwn
90
91    You can also add any files you like from scratch of course.
92
93 6. Repeat steps 4 and 5 as desired, editing or adding pages and rebuilding
94    the wiki. You can play around with other ikiwiki parameters such as
95    `--wikiname` and `--rebuild` too. Get comfortable with its command line
96    (see [[usage]]).
97
98 7. By now you should be getting tired of typing in all the command line
99    options each time you change something in your wiki's setup. And it's
100    also getting old to have to manualy rebuild the wiki each time you
101    change a file. Time to introduce setup files. 
102    
103    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
104    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. 
105    
106    Most of the options, like `wikiname` in the setup file are the same as
107    ikiwiki's command line options (documented in [[usage]]. `srcdir` and
108    `destdir` are the two directories you specify when running ikiwiki by
109    hand. `svnrepo` is the path to your subversion repository.  Make sure
110    that all of these are pointing to the right directories, and read
111    through and configure the rest of the file to your liking.
112
113    If you want to use something other than subversion, comment out the
114    subversion configuration, and uncomment and edit the configuration for
115    your chosen RCS.
116
117    Note that the default file has a block to configure a [[post-commit]] 
118    wrapper to update the wiki. You need to uncomment the related block for
119    whatever RCS you use and comment out the other rcs blocks.
120
121    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
122    will set everything up and update your wiki.
123
124 8. Set up [[CGI]] to allow editing the wiki from the web.
125
126    Just edit ikiwiki.setup, uncomment the block for the cgi wrapper, make
127    sure the filename for the cgi wrapper is ok, run 
128    `ikiwiki --setup ikiwiki.setup`, and you're done!
129
130 9. Add [[PageHistory]] links to the top of pages. This requires you to have
131    setup a repository browser.  For Subversion, you may use [[ViewCVS]] or
132    something similar to access your [[Subversion]] repository.  For Git,
133    [[Gitweb]] can be used, etc.
134    
135    The `historyurl` setting makes ikiwiki add the links, and in that url,
136    "\[[file]]" is replaced with the name of the file to view. So edit
137    ikiwiki.setup and ucomment the appropriate `historyurl` setting and edit
138    it for your setup.
139    
140    Then run `ikiwiki --setup ikiwiki.setup` again.
141
142 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]].