]> sipb.mit.edu Git - ikiwiki.git/blob - doc/setup.mdwn
(no commit message)
[ikiwiki.git] / doc / setup.mdwn
1 This tutorial will walk you through setting up a wiki with ikiwiki.
2
3 [[!toc ]]
4
5 ## Install ikiwiki
6
7 If you're using Debian or Ubuntu, ikiwiki is an <code><a href="http://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_basic_package_management_operations">apt-get</a> install ikiwiki</code> away.
8 If you're not, see the [[download]] and [[install]] pages.
9
10 You may also want to try out a [[Docker image|https://github.com/elecnix/ikiwiki-docker]] with ikiwiki pre-installed.
11
12 ## Create your wiki
13
14 All it takes to create a fully functional wiki using ikiwiki is running
15 one command.
16 [[!template id=note text="""
17 For more control, advanced users may prefer to set up a wiki
18 [[by_hand|byhand]].
19 """]]
20
21         % ikiwiki --setup /etc/ikiwiki/auto.setup
22
23 Or, set up a blog with ikiwiki, run this command instead.
24
25         % ikiwiki --setup /etc/ikiwiki/auto-blog.setup
26
27 `librpc-xml-perl` and `python-docutils` dependencies are needed.
28
29 Either way, it will ask you a couple of questions.
30
31         What will the wiki be named? foo
32         What revision control system to use? git
33         What wiki user (or openid) will be admin? joey
34         Choose a password:
35
36 Then, wait for it to tell you an url for your new site..
37
38         Successfully set up foo:
39                 url:         http://example.com/~joey/foo
40                 srcdir:      ~/foo
41                 destdir:     ~/public_html/foo
42                 repository:  ~/foo.git
43         To modify settings, edit ~/foo.setup and then run:
44                 ikiwiki --setup ~/foo.setup
45
46 Done! 
47
48 ## Using the web interface
49
50 Now you can go to the url it told you, and edit pages in your new wiki
51 using the web interface.
52
53 (If the web interface doesn't seem to allow editing or login, you may
54 need to [[configure_the_web_server|tips/dot_cgi]].)
55
56 ## Checkout and edit wiki source
57
58 Part of the fun of using ikiwiki is not being limited to using the
59 web for editing pages, and instead using your favorite text editor and
60 [[Revision_Control_System|rcs]]. 
61
62 To do this, you need to check out a copy of the source to your wiki.
63 (You should avoid making changes directly to the `srcdir`, as that
64 checkout is reserved for use by ikiwiki itself.)
65
66 Depending on which [[Revision_Control_System|rcs]] you chose to use,
67 you can run one of these commands to check out your own copy of your wiki's
68 source. (Remember to replace "foo" with the real directory name.)
69
70         git clone foo.git foo.src
71         svn checkout file://`pwd`/foo.svn/trunk foo.src
72         cvs -d `pwd`/foo get -P ikiwiki
73         bzr clone foo foo.src
74         hg clone foo foo.src
75         darcs get foo.darcs foo.src
76         # TODO monotone, tla
77
78 Now to edit pages by hand, go into the directory you checked out (ie,
79 "foo.src"), and fire up your text editor to edit `index.mdwn` or whatever
80 other page you want to edit. If you chose to set up a blog, there is even a
81 sample first post in `posts/first_post.mdwn` that you can edit.
82
83 Once you've edited a page, use your revision control system to commit
84 the changes. For distributed revision control systems, don't forget to push
85 your commit.
86
87 Once the commit reaches the repository, ikiwiki will notice it, and
88 automatically update the wiki with your changes.
89
90 ## Customizing the wiki
91
92 There are lots of things you can configure to customize your wiki.
93 These range from changing the wiki's name, to enabling [[plugins]],
94 to banning users and locking pages.
95
96 If you log in as the admin user you configured earlier, and go to
97 your Preferences page, you can click on "Setup" to customize many
98 wiki settings and plugins.
99
100 Some settings cannot be configured on the web, for security reasons or
101 because misconfiguring them could break the wiki. To change these settings,
102 you can manually edit the setup file, which is named something like
103 "foo.setup". The file lists all available configuration settings
104 and gives a brief description of each.
105
106 After making changes to this file, you need to tell ikiwiki to use it:
107
108         % ikiwiki --setup foo.setup
109
110 Alternatively, you can ask ikiwiki to change settings in the file for you:
111
112         % ikiwiki --changesetup foo.setup --plugin goodstuff
113
114 See [[usage]] for more options.
115
116 ## Customizing file locations
117
118 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
119 and outputs the files to a destination directory. The source directory is
120 a working copy checked out from the version control system repository.
121
122 When you used `auto.setup`, ikiwiki put the source directory, destination
123 directory, and repository in your home directory, and told you the location
124 of each. Those locations were chosen to work without customization, but you
125 might want to move them to different directories.
126
127 First, move the destination directory and repository around.
128    
129         % mv public_html/foo /srv/web/foo.com
130         % mv foo.git /srv/git/foo.git
131
132 If you moved the repository to a new location, checkouts pointing at the
133 old location won't work, and the easiest way to deal with this is to delete
134 them and re-checkout from the new repository location.
135    
136         % rm -rf foo
137         % git clone /srv/git/foo.git
138
139 Finally, edit the setup file. Modify the settings for `srcdir`, `destdir`,
140 `url`, `cgiurl`, `cgi_wrapper`, `git_wrapper`, etc to reflect where
141 you moved things. Remember to run `ikiwiki --setup` after editing the
142 setup file.
143
144 ## Enjoy your new wiki!
145
146 Add yourself to [[IkiWikiUsers]]. And check out
147 the [[tips]] to find out how to get more out of ikiwiki.
148
149 ----
150
151 _Notes_:
152
153 - If you are searching for the file where the users are stored, it's in `your_repository/.ikiwiki/userdb`. The one which is in YOUR REPOSITORY, it cannot be found into your `~/.ikiwiki`.
154 - If you want to enable a plugin you **WILL HAVE** to add it to the `add_plugins` array in the `*.setup` file (or to use the `--plugin` switch while calling `ikiwiki`). Uncommenting the plugin options/configuration fields in the setup is not **ALWAYS** sufficient. You have been warned.