add byhand document, containing the old setup document
[ikiwiki] / 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 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.
9
10 ## Create your wiki
11
12 All it takes to create a fully functional wiki using ikiwiki is running
13 one command.
14 [[!template id=note text="""
15 For more control, advanced users may prefer to set up a wiki
16 [[by_hand|byhand]].
17 """]]
18
19         % ikiwiki -setup /etc/ikiwiki/auto.setup
20
21 Or, set up a blog with ikiwiki, run this command instead.
22
23         % ikiwiki -setup /etc/ikiwiki/auto-blog.setup
24
25 Either way, it will ask you a couple of questions.
26
27         What will the wiki be named? foo
28         What revision control system to use? git
29         What wiki user (or openid) will be admin? joey
30         Choose a password:
31
32 Then, wait for it to tell you an url for your new site..
33
34         Successfully set up foo:
35                 url:         http://example.com/~joey/foo
36                 srcdir:      ~/foo
37                 destdir:     ~/public_html/foo
38                 repository:  ~/foo.git
39         To modify settings, edit ~/foo.setup and then run:
40                 ikiwiki -setup ~/foo.setup
41
42 Done! 
43
44 ## Using the web interface
45
46 Now you can go to the url it told you, and edit pages in your new wiki
47 using the web interface.
48
49 You can log in using the wiki user and password (or the openid)
50 that you told it to set up earlier. That user is an admin, so you can
51 go to the Preferences page and click on "Wiki Setup" to further
52 configure the wiki.
53
54 (If the web interface doesn't seem to allow editing or login, you may
55 need to configure [[apache|tips/apache_cgi]] or 
56 [[lighttpd|tips/lighttpd_cgi]].)
57
58 ## Checkout and edit wiki source
59
60 Part of the fun of using ikiwiki is not being limited to using the
61 web for editing pages, and instead using your favorite text editor and
62 [[Revision_Control_System|rcs]]. 
63
64 To do this, you need to check out a copy of the source to your wiki.
65 You should avoid making changes directly to the `srcdir`, as that
66 checkout is reserved for use by ikiwiki itself.
67
68 Depending on which [[Revision_Control_System|rcs]] you chose to use,
69 you can run one of these commands to check out your own copy of your wiki's
70 source. (Remember to replace "foo" with the real directory name.)
71
72         git clone foo.git foo.src
73         svn checkout file://`pwd`/foo.svn/trunk foo.src
74         bzr clone foo foo.src
75         hg clone foo 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 "Wiki 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 ## Customizing file locations
111
112 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
113 and outputs the files to a destination directory. The source directory is
114 a working copy checked out from the version control system repository.
115
116 When you used `auto.setup`, ikiwiki put the source directory, destination
117 directory, and repository in your home directory, and told you the location
118 of each. Those locations were chosen to work without customization, but you
119 might want to move them to different directories. There are three steps to
120 this process.
121
122 1. Move the destination directory and repository around.
123
124         % mv public_html/foo /srv/web/foo.com
125         % mv foo.git /srv/git/foo.git
126
127 2. Create a new source directory checkout. If you moved the repository
128    to a new location, checkouts pointing at the old location won't work,
129    and the easiest way to deal with this is to delete them and re-checkout
130    from the new repository location.
131
132         % rm -rf foo
133         % git clone /src/git/foo.git
134
135 3. Edit the setup file. Modify the settings for `srcdir`, `destdir`,
136    `url`, `cgiurl`, `cgi_wrapper`, `git_wrapper`, etc to reflect where
137    you moved things. Remember to run `ikiwiki -setup` after editing the
138    setup file.
139
140 ## Enjoy your new wiki!
141
142 Add yourself to [[IkiWikiUsers]]. And check out
143 the [[tips]] to find out how to get more out of ikiwiki.