]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
web commit by JeremyReed: hard-coded perl path
[ikiwiki.git] / doc / setup.mdwn
1 This tutorial will walk you through setting up a wiki with ikiwiki.
2
3 [[toc ]]
4
5 ## [[Download]] and [[install]] ikiwiki.
6
7 ## Decide where your wiki's files will go.
8
9 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
10 and outputs the files to a destination directory.  If you keep your wiki in
11 a version control system, the source directory will contain a working copy
12 checked out from the version control system.
13
14 For the purposes of this tutorial, we'll set shell variables
15 for these locations, and use those variables in the commands that follow.
16
17         SRCDIR=~/wikiwc
18         DESTDIR=~/public_html/wiki/
19
20 Note that ikiwiki owns the working copy directory; do not perform your own
21 edits in ikiwiki's working copy.
22
23 ## Create the beginnings of your wiki.
24
25 This will create a simple main page for the wiki.
26
27         mkdir $SRCDIR
28         cd $SRCDIR
29         $EDITOR index.mdwn
30
31 In the editor, you could start by entering a simple page like
32 [[toggle id=page text="this one"]].
33 [[toggleable id=page text="""
34         Welcome to your new wiki.
35
36         All wikis are supposed to have a \[[SandBox]],
37         so this one does too.
38
39         ----
40
41         This wiki is powered by [ikiwiki](http://ikiwiki.info).
42 """]]
43    
44 See [[ikiwiki/formatting]] for details about the markup language.
45
46 Note that several [[standard_wiki_pages|basewiki]] will be added to your
47 wiki, from files in `/usr/share/ikiwiki/basewiki/`, so your wiki will
48 automatically get a [[SandBox]], and some other useful pages.
49
50 ## Build your wiki for the first time.
51
52         ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/
53
54 Replace the url with the real url to your wiki. You should now
55 be able to visit the url and see your wiki.
56
57 ## Add content to your wiki.
58
59 Continue editing or adding pages and rebuilding the wiki.
60    
61 To quickly get started on a common task like blogging with ikiwiki, you
62 can copy in files from the [[examples]]. The examples are located in
63 `doc/examples/` in the ikiwiki source package.
64
65 You can experiment with other ikiwiki parameters such as `--wikiname`
66 and `--rebuild` too. Get comfortable with its command line (see
67 [[usage]]).
68
69 ## Add a setup file.
70
71 By now you should be getting tired of typing in all the command line
72 options each time you change something in your wiki's setup. Time to
73 introduce setup files.
74    
75 A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
76 `doc/ikiwiki.setup` in the ikiwiki sources), and edit it. Note that this
77 file should *not* be put in your wiki's directory with the rest of the
78 files. A good place to put it is in a ~/.ikiwiki/ subdirectory.
79    
80 Most of the options, like `wikiname` in the setup file are the same as
81 ikiwiki's command line options (documented in [[usage]]. `srcdir` and
82 `destdir` are the two directories you specify when running ikiwiki by
83 hand. Make sure that these are pointing to the right directories, and
84 read through and configure the rest of the file to your liking.
85
86 When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
87 will set everything up.
88
89 ## Turn on additional features.
90
91 Now you have a basic wiki with a configuration file. Time to experiment
92 with ikiwiki's many features. 
93    
94 Let's first enable a key wiki feature and set up [[CGI]] to allow
95 editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
96 block for the cgi wrapper, make sure the filename for the cgi wrapper
97 is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
98
99 There are lots of other configuration options in ikiwiki.setup that you
100 can uncomment, configure, and enable by re-running
101 `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
102 [[plugins]]..
103
104 ## Put your wiki in revision control.
105
106 At this point you might want to check your wiki in to a revision control
107 system so you can keep track of changes and revert edits. Depending
108 on the revision control system you choose, the way this is done varies.
109
110 Note that the .ikiwiki subdirectory is where ikiwiki keeps its state, and
111 should be preserved, but not checked into revision control.
112
113 The new [[ikiwiki-makerepo]] command automates setting up a wiki in
114 revision control.
115
116 [[toggle id=subversion text="Subversion"]]
117 [[toggleable id=subversion text="""
118         REPOSITORY=~/wikirepo
119         ikiwiki-makerepo svn $SRCDIR $REPOSITORY
120 """]]
121
122 [[toggle id=git text="Git"]]
123 [[toggleable id=git text="""
124         REPOSITORY=~/wiki.git
125         ikiwiki-makerepo git $SRCDIR $REPOSITORY
126
127 Please see [[rcs/git]] for detailed documentation about how
128 ikiwiki uses git repositories, and some important caveats
129 about using the git repositories.
130 """]]
131
132 [[toggle id=mercurial text="Mercurial"]]
133 [[toggleable id=mercurial text="""
134         REPOSITORY=$SRCDIR
135         ikiwiki-makerepo mercurial $SRCDIR
136 """]]
137
138 [[toggle id=bazaar text="Bazaar"]]
139 [[toggleable id=bazaar text="""
140         REPOSITORY=$SRCDIR
141         ikiwiki-makerepo bzr $SRCDIR
142 """]]
143
144 [[toggle id=tla text="TLA"]]
145 [[toggleable id=tla text="""
146         REPOSITORY=~/wikirepo
147         tla make-archive me@localhost--wiki $REPOSITORY
148         tla my-id "<me@localhost>"
149         cd $SRCDIR
150         tla archive-setup me@localhost--wiki/wiki--0
151         tla init-tree me@localhost--wiki/wiki--0
152         # Edit {arch}/=tagging-method and change the precious
153         # line to add the .ikiwiki directory to the regexp.
154         tla add *
155         tla import
156 """]]
157
158 [[toggle id=monotone text="Monotone"]]
159 [[toggleable id=monotone text="""
160         # These instructions are standard instructions to import a directory into monotone
161         # and set it up so that you don't need any passwords to use it
162         REPOSITORY=~/.ikiwiki/mtn.db
163         BRANCH=com.company.wikiname
164         # remember the password you use in the next step and
165         # substitute it for 'wikiKeyPass' in the get_passphrase() hook below
166         # note the you should never generate two monotone keys with the same name
167         mtn genkey web@machine.company.com
168         mtn db init --db=$REPOSITORY
169         mv $SRCDIR $SRCDIR-old
170         cd $SRCDIR-old
171         echo ".ikiwiki" > $SRCDIR-old/.mtn-ignore
172         mtn --db=$REPOSITORY --branch=$BRANCH import . -m "initial import"
173         cd ..
174         mtn --db=$REPOSITORY --branch=$BRANCH checkout $SRCDIR
175         mv $SRCDIR-old/.ikiwiki $SRCDIR
176         cat << EOF > $SRCDIR/_MTN/monotonerc
177         function get_passphrase (branchname)
178             return "wikiKeyPass"
179         end
180         EOF
181         rm -r $SRCDIR-old
182 """]]
183
184 ## Configure ikiwiki to use revision control.
185
186 Once your wiki is checked in to the revision control system,
187 you should configure ikiwiki to use revision control. Edit your
188 ikiwiki.setup, and uncomment the lines for the revision control system
189 you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using
190 subversion. Uncomment the block for the wrapper for your revision
191 control system, and configure the wrapper path in that block
192 appropriately (for Git, it should be `$REPOSITORY/hooks/post-update`).
193
194 Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
195 Now you should be able to edit files in $SRCDIR, and use your revision
196 control system to commit them, and the wiki will automatically update.
197 And in the web interface, RecentChanges should work, and files changed
198 by web users will also be committed using revision control.
199
200 ## Enjoy your new wiki!
201
202 Add yourself to [[IkiWikiUsers]]. And check out
203 the [[tips]] to find out how to get more out of ikiwiki.