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