]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
formatting
[ikiwiki.git] / doc / setup.mdwn
1 This tutorial will walk you through setting up a wiki with ikiwiki.
2
3 1. [[Install]] ikiwiki. See [[download]] for where to get it.
4
5 2. Decide where your wiki's files will go.
6
7    As a wiki compiler, ikiwiki builds a wiki from files in a source
8    directory, and outputs the files to a destination directory.
9
10    For the purposes of this tutorial, we'll set shell variables
11    for these locations, and use those variables in the commands that follow.
12
13                 SRCDIR=~/wikiwc
14                 DESTDIR=~/public_html/wiki/
15
16 3. Create the beginnings of your wiki.
17
18    This will create a simple main page for the wiki.
19
20                 mkdir $SRCDIR
21                 cd $SRCDIR
22                 $EDITOR index.mdwn
23
24    In the editor, you could start by entering a simple page like this one:
25
26                 Welcome to your new wiki.
27                 All wikis are supposed to have a [[SandBox]], so this one does too.
28                 ----
29                 This wiki is powered by [ikiwiki](http://ikiwiki.kitenet.net).
30
31    See [[HelpOnFormatting]] for details about the markup language.
32
33    Note that several standard wiki pages will be added to your wiki, from
34    files in `/usr/share/ikiwiki/basewiki/`, so your wiki will automatically
35    get a [[SandBox]], and some other useful pages.
36
37 4. Build your wiki for the first time.
38
39                 ikiwiki --verbose $SRCDIR $DESTDIR --url=http://host/~you/wiki/
40
41    Replace the url with the real url to your wiki. You should now
42    be able to visit the url and see your wiki.
43
44 5. Repeat steps 3 and 4 as desired, editing or adding pages and rebuilding
45    the wiki. You can play around with other ikiwiki parameters such as
46    `--wikiname` and `--rebuild` too. Get comfortable with its command line
47    (see [[usage]]).
48
49 6. By now you should be getting tired of typing in all the command line
50    options each time you change something in your wiki's setup. Time to
51    introduce setup files.
52    
53    A sample setup file is [[ikiwiki.setup]]. Download it (or copy it from
54    `doc/ikiwiki.setup` in the ikiwiki sources), and edit it.
55    
56    Most of the options, like `wikiname` in the setup file are the same as
57    ikiwiki's command line options (documented in [[usage]]. `srcdir` and
58    `destdir` are the two directories you specify when running ikiwiki by
59    hand. Make sure that these are pointing to the right directories, and
60    read through and configure the rest of the file to your liking.
61
62    When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
63    will set everything up.
64
65 7. Turn on additional features.
66
67    Now you have a basic wiki with a configuration file. Time to experiment
68    with ikiwiki's many features. 
69    
70    Let's first enable a key wiki feature and set up [[CGI]] to allow
71    editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
72    block for the cgi wrapper, make sure the filename for the cgi wrapper
73    is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
74
75    There are lots of other configuration options in ikiwiki.setup that you
76    can uncomment, configure, and enable by re-running
77    `ikiwiki --setup ikiwiki.setup`. Be sure to browse through all the
78    [[plugins]]..
79
80 8. Put your wiki in revision control.
81
82    At this point you might want to check your wiki in to a revision control
83    system you can get history of past changes and revert edits. Depending
84    on the revision control system you choose, the way this is done varies.
85    
86    There's little that's ikiwiki specific about these instructions; this is
87    just how you put a directory under revision control using the various
88    systems ikiwiki supports:
89    
90                 # Subversion
91                 REPOSITORY=~/wikirepo
92                 svnadmin create $REPOSITORY
93                 svn import $SRCDIR file://$REPOSITORY/trunk -m "initial import"
94                 rm -rf $SRCDIR
95                 svn co file://$REPOSITORY/trunk $SRCDIR
96                  
97                 # Git
98                 REPOSITORY=~/wikirepo
99                 mkdir $REPOSITORY
100                 cd $REPOSITORY
101                 git init-db
102                 cp -a $SRCDIR/* .
103                 git add .
104                 git commit -m "initial import" -a
105                 rm -rf $SRCDIR
106                 git clone -l -s $REPOSITORY $SRCDIR
107
108                 # TLA
109                 REPOSITORY=~/wikirepo
110                 tla make-archive me@localhost--wiki $REPOSITORY
111                 tla my-id "<me@localhost>"
112                 cd $SRCDIR
113                 tla archive-setup me@localhost--wiki/wiki--0
114                 tla init-tree me@localhost--wiki/wiki--0
115                 # Edit {arch}/=tagging-method and change the precious
116                 # line to add the .ikiwiki directory to the regexp.
117                 tla add *
118                 tla import
119
120                 # Mercurial
121                 REPOSITORY=$SRCDIR
122                 hg init $REPOSITORY
123
124 9. Configure ikiwiki to use revision control.
125
126    Once your wiki is checked in to the revision control system,
127    you should configure ikiwiki to use revision control. Edit your
128    ikiwiki.setup, and uncomment the lines for the revision control system
129    you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using
130    subversion. Uncomment the block for the wrapper for your revision
131    control system, and configure the wrapper path in that block
132    appropriately. 
133    
134    Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
135    Now you should be able to edit files in $SRCDIR, and use your revision
136    control system to commit them, and the wiki will automatically update.
137    And in the web interface, RecentChanges should work, and files changed
138    by web users will also be committed using revision control.
139
140 10. Enjoy your new wiki! Add yourself to [[IkiWikiUsers]].