1 This tutorial will walk you through setting up a wiki with ikiwiki.
5 ## [[Download]] and [[install]] ikiwiki.
7 If you're using Debian or Ubuntu, ikiwiki is an `apt-get install ikiwiki` away.
8 If you're not, see the [[download]] and [[install]] pages.
12 If you'd like to set up a wiki now, and learn more later, and you have
13 ikiwiki 2.60 or better installed, just run this command and answer a couple
16 % ikiwiki -setup /etc/ikiwiki/auto.setup
17 What will the wiki be named? mywiki
18 What revision control system to use? git
19 What wiki user (or openid) will be wiki admin? joey
21 Wait for it to tell you an url for your new wiki.. Done!
23 (If the CGI doesn't seem to let you edit pages, you might need to
24 [[configure_apache|apache_cgi]]).)
26 ## Decide where your wiki's files will go.
28 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
29 and outputs the files to a destination directory. If you keep your wiki in
30 a version control system, the source directory will contain a working copy
31 checked out from the version control system.
33 For the purposes of this tutorial, we'll set shell variables
34 for these locations, and use those variables in the commands that follow.
37 DESTDIR=~/public_html/wiki/
39 Note that ikiwiki owns the working copy directory; do not perform your own
40 edits in ikiwiki's working copy.
42 ## Create the beginnings of your wiki.
44 This will create a simple main page for the wiki.
50 In the editor, you could start by entering a simple page like
51 [[!toggle id=page text="this one"]].
52 [[!toggleable id=page text="""
53 Welcome to your new wiki.
55 All wikis are supposed to have a \[[SandBox]],
60 This wiki is powered by [ikiwiki](http://ikiwiki.info).
63 See [[ikiwiki/formatting]] for details about the markup language.
65 Note that several [[standard_wiki_pages|basewiki]] will be added to your
66 wiki, from files in `/usr/share/ikiwiki/basewiki/`, so your wiki will
67 automatically get a [[SandBox]], and some other useful pages.
69 ## Build your wiki for the first time.
71 ikiwiki --verbose $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/
73 Replace the url with the real url to your wiki. You should now
74 be able to visit the url and see your wiki.
76 ## Add content to your wiki.
78 Continue editing or adding pages and rebuilding the wiki.
80 To quickly get started on a common task like blogging with ikiwiki, you
81 can copy in files from the [[examples]]. The examples are located in
82 `doc/examples/` in the ikiwiki source package.
84 You can experiment with other ikiwiki parameters such as `--wikiname`
85 and `--rebuild` too. Get comfortable with its command line (see
90 By now you should be getting tired of typing in all the command line
91 options each time you change something in your wiki's setup. Time to
92 introduce setup files.
94 To generate a setup file, use `ikiwiki --dumpsetup`. You can pass
95 all the options have you been including at the command line, and they
96 will be stored in the setup file.
98 ikiwiki $SRCDIR $DESTDIR --url=http://example.org/~you/wiki/ --dumpsetup ikiwiki.setup
100 Note that this file should *not* be put in your wiki's directory with
101 the rest of the files. A good place to put it is in a ~/.ikiwiki/
104 Most of the options, like `wikiname` in the setup file are the same as
105 ikiwiki's command line options (documented in [[usage]]. `srcdir` and
106 `destdir` are the two directories you specify when running ikiwiki by
107 hand. Make sure that these are pointing to the right directories, and
108 read through and configure the rest of the file to your liking.
110 When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
111 will set everything up.
113 ## Turn on additional features.
115 Now you have a basic wiki with a setup file. Time to experiment
116 with ikiwiki's many features.
118 Let's first enable a key wiki feature and set up [[CGI]] to allow
119 editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
120 settings for the `cgi_wrapper`, make sure the filename for the cgi wrapper
121 is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
123 There are lots of other configuration options in ikiwiki.setup that you
124 can uncomment, configure, and enable by re-running
125 `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
128 ## Put your wiki in revision control.
130 At this point you might want to check your wiki in to a revision control
131 system so you can keep track of changes and revert edits. Depending
132 on the revision control system you choose, the way this is done varies.
134 Note that the .ikiwiki subdirectory is where ikiwiki keeps its state, and
135 should be preserved, but not checked into revision control.
137 The [[ikiwiki-makerepo]] command automates setting up a wiki in
140 [[!toggle id=subversion text="Subversion"]]
141 [[!toggleable id=subversion text="""
142 REPOSITORY=~/wikirepo
143 ikiwiki-makerepo svn $SRCDIR $REPOSITORY
146 [[!toggle id=git text="Git"]]
147 [[!toggleable id=git text="""
148 REPOSITORY=~/wiki.git
149 ikiwiki-makerepo git $SRCDIR $REPOSITORY
151 Please see [[rcs/git]] for detailed documentation about how
152 ikiwiki uses git repositories, and some important caveats
153 about using the git repositories.
156 [[!toggle id=mercurial text="Mercurial"]]
157 [[!toggleable id=mercurial text="""
159 ikiwiki-makerepo mercurial $SRCDIR
162 [[!toggle id=bazaar text="Bazaar"]]
163 [[!toggleable id=bazaar text="""
165 ikiwiki-makerepo bzr $SRCDIR
168 [[!toggle id=tla text="TLA"]]
169 [[!toggleable id=tla text="""
170 REPOSITORY=~/wikirepo
171 tla make-archive me@localhost--wiki $REPOSITORY
172 tla my-id "<me@localhost>"
174 tla archive-setup me@localhost--wiki/wiki--0
175 tla init-tree me@localhost--wiki/wiki--0
176 # Edit {arch}/=tagging-method and change the precious
177 # line to add the .ikiwiki directory to the regexp.
182 [[!toggle id=monotone text="Monotone"]]
183 [[!toggleable id=monotone text="""
184 # This assumes that you have already used "mtn genkey you@hostname".
185 REPOSITORY=~/wiki.monotone
186 ikiwiki-makerepo monotone $SRCDIR $REPOSITORY
189 ## Configure ikiwiki to use revision control.
191 Once your wiki is checked in to the revision control system, you should
192 configure ikiwiki to use revision control. Edit your ikiwiki.setup, set
193 `rcs` to the the revision control system you chose to use. Be sure to set
194 `svnrepo` to the directory for your repository, if using subversion.
195 Uncomment the configuration for the wrapper for your revision control
196 system, and configure the wrapper path appropriately (for Git, it should be
197 the path to `hooks/post-update` inside the bare git repository).
199 Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
200 Now you should be able to edit files in $SRCDIR, and use your revision
201 control system to commit them, and the wiki will automatically update.
202 And in the web interface, RecentChanges should work, and files changed
203 by web users will also be committed using revision control.
205 ## Enjoy your new wiki!
207 Add yourself to [[IkiWikiUsers]]. And check out
208 the [[tips]] to find out how to get more out of ikiwiki.