not sure this is necessary
[ikiwiki] / 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 sandboxed [[Docker image|https://github.com/elecnix/ikiwiki-docker]]
11 with ikiwiki pre-installed or this other [[one|https://github.com/dgsb/docker-ikiwiki]] which will use a volume to access a local git repository
12 for the wiki content.
13
14 ## Create your wiki
15
16 All it takes to create a fully functional wiki using ikiwiki is running
17 one command.
18 [[!template id=note text="""
19 For more control, advanced users may prefer to set up a wiki
20 [[by_hand|byhand]].
21 """]]
22
23         % ikiwiki --setup /etc/ikiwiki/auto.setup
24
25 Or, set up a blog with ikiwiki, run this command instead.
26
27         % ikiwiki --setup /etc/ikiwiki/auto-blog.setup
28
29 `librpc-xml-perl` and `python-docutils` dependencies are needed.
30
31 Either way, it will ask you a couple of questions.
32
33         What will the wiki be named? foo
34         What revision control system to use? git
35         What wiki user (or openid) will be admin? joey
36         Choose a password:
37
38 Then, wait for it to tell you an url for your new site..
39
40         Successfully set up foo:
41                 url:         http://example.com/~joey/foo
42                 srcdir:      ~/foo
43                 destdir:     ~/public_html/foo
44                 repository:  ~/foo.git
45         To modify settings, edit ~/foo.setup and then run:
46                 ikiwiki --setup ~/foo.setup
47
48 Done! 
49
50 ## Using the web interface
51
52 Now you can go to the url it told you, and edit pages in your new wiki
53 using the web interface.
54
55 (If the web interface doesn't seem to allow editing or login, you may
56 need to [[configure_the_web_server|tips/dot_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         cvs -d `pwd`/foo get -P ikiwiki
75         bzr clone foo foo.src
76         hg clone foo foo.src
77         darcs get foo.darcs foo.src
78         # TODO monotone, tla
79
80 Now to edit pages by hand, go into the directory you checked out (ie,
81 "foo.src"), and fire up your text editor to edit `index.mdwn` or whatever
82 other page you want to edit. If you chose to set up a blog, there is even a
83 sample first post in `posts/first_post.mdwn` that you can edit.
84
85 Once you've edited a page, use your revision control system to commit
86 the changes. For distributed revision control systems, don't forget to push
87 your commit.
88
89 Once the commit reaches the repository, ikiwiki will notice it, and
90 automatically update the wiki with your changes.
91
92 ## Customizing the wiki
93
94 There are lots of things you can configure to customize your wiki.
95 These range from changing the wiki's name, to enabling [[plugins]],
96 to banning users and locking pages.
97
98 If you log in as the admin user you configured earlier, and go to
99 your Preferences page, you can click on "Setup" to customize many
100 wiki settings and plugins.
101
102 Some settings cannot be configured on the web, for security reasons or
103 because misconfiguring them could break the wiki. To change these settings,
104 you can manually edit the setup file, which is named something like
105 "foo.setup". The file lists all available configuration settings
106 and gives a brief description of each.
107
108 After making changes to this file, you need to tell ikiwiki to use it:
109
110         % ikiwiki --setup foo.setup
111
112 Alternatively, you can ask ikiwiki to change settings in the file for you:
113
114         % ikiwiki --changesetup foo.setup --plugin goodstuff
115
116 See [[usage]] for more options.
117
118 ## Customizing file locations
119
120 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
121 and outputs the files to a destination directory. The source directory is
122 a working copy checked out from the version control system repository.
123
124 When you used `auto.setup`, ikiwiki put the source directory, destination
125 directory, and repository in your home directory, and told you the location
126 of each. Those locations were chosen to work without customization, but you
127 might want to move them to different directories.
128
129 First, move the destination directory and repository around.
130    
131         % mv public_html/foo /srv/web/foo.com
132         % mv foo.git /srv/git/foo.git
133
134 If you moved the repository to a new location, checkouts pointing at the
135 old location won't work, and the easiest way to deal with this is to delete
136 them and re-checkout from the new repository location.
137    
138         % rm -rf foo
139         % git clone /srv/git/foo.git
140
141 Finally, edit the setup file. Modify the settings for `srcdir`, `destdir`,
142 `url`, `cgiurl`, `cgi_wrapper`, `git_wrapper`, etc to reflect where
143 you moved things. Remember to run `ikiwiki --setup` after editing the
144 setup file.
145
146 ## Enjoy your new wiki!
147
148 Add yourself to [[IkiWikiUsers]]. And check out
149 the [[tips]] to find out how to get more out of ikiwiki.
150
151 ----
152
153 _Notes_:
154
155 - 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`.
156 - 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.