Skip to content
This repository
Newer
Older
100644 603 lines (438 sloc) 21.283 kb
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
1 Gitit
2 =====
89725fd9 »
2008-11-06 Initial commit.
3
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
4 Gitit is a wiki program written in Haskell. It uses [Happstack][] for
5 the web server and [pandoc][] for markup processing. Pages and uploaded
6 files are stored in a [git][], [darcs][], or [mercurial][] repository
7 and may be modified either by using the VCS's command-line tools or
8 through the wiki's web interface. By default, pandoc's extended version
9 of markdown is used as a markup language, but reStructuredText, LaTeX,
10 or HTML can also be used. Pages can be exported in a number of different
0f4f9c6e »
2009-06-05 Indicate in README that LaTeX or HTML formats can be used.
11 formats, including LaTeX, RTF, OpenOffice ODT, and MediaWiki markup.
ff6f3b95 »
2009-08-23 Updated math part of README.
12 Gitit can be configured to display TeX math (using [texmath][]) and
0f4f9c6e »
2009-06-05 Indicate in README that LaTeX or HTML formats can be used.
13 highlighted source code (using [highlighting-kate][]).
89725fd9 »
2008-11-06 Initial commit.
14
0d14feb7 »
2009-08-23 Added links to demo site in documentation and gitit.cabal.
15 Other features include
16
17 * plugins: dynamically loaded page transformations written in Haskell
18 (see "Network.Gitit.Interface")
19
20 * categories
21
22 * TeX math
23
24 * syntax highlighting of source code files and code snippets (using
25 highlighting-kate)
26
27 * caching
28
29 * Atom feeds (site-wide and per-page)
30
31 * a library, "Network.Gitit", that makes it simple to include a gitit
32 wiki in any happstack application
33
34 You can see a running demo at <http://gitit.johnmacfarlane.net>.
35
f22d5c4a »
2009-08-14 Changed default config to use-cache: no.
36 [git]: http://git.or.cz
d9c8cd8b »
2009-01-24 Modified description slightly, mentioning darcs as well as git.
37 [darcs]: http://darcs.net
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
38 [mercurial]: http://mercurial.selenic.com/
89725fd9 »
2008-11-06 Initial commit.
39 [pandoc]: http://johnmacfarlane.net/pandoc
fd9eed57 »
2009-03-10 Changed mentions of HAppS to Happstack.
40 [Happstack]: http://happstack.com
f22d5c4a »
2009-08-14 Changed default config to use-cache: no.
41 [highlighting-kate]: http://johnmacfarlane.net/highlighting-kate/
ff6f3b95 »
2009-08-23 Updated math part of README.
42 [texmath]: http://github.com/jgm/texmath/tree/master
89725fd9 »
2008-11-06 Initial commit.
43
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
44 Getting started
45 ===============
89725fd9 »
2008-11-06 Initial commit.
46
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
47 Compiling and installing gitit
48 ------------------------------
89725fd9 »
2008-11-06 Initial commit.
49
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
50 You'll need the [GHC][] compiler and the [cabal-install][] tool. GHC can
98adca8b »
2009-01-28 Note the GHC 6.10 requirement in README.
51 be downloaded [here][]. Note that, starting with release 0.5, GHC 6.10
52 or higher is required. For [cabal-install][] on *nix, follow the [quick
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
53 install][] instructions.
89725fd9 »
2008-11-06 Initial commit.
54
55 [GHC]: http://www.haskell.org/ghc/
56 [here]: http://www.haskell.org/ghc/
57 [cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
6a6388be » pvorb
2012-07-17 Fix some minor issues in README
58 [quick install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall#Quick+Installation+on+Unix
89725fd9 »
2008-11-06 Initial commit.
59
97e00433 » John MacFarlane
2009-04-18 Improved README.
60 Once you've got cabal-install, installing gitit is trivial:
89725fd9 »
2008-11-06 Initial commit.
61
a7c11fe8 »
2008-11-30 Simplified installation instructions.
62 cabal update
89725fd9 »
2008-11-06 Initial commit.
63 cabal install gitit
64
a7c11fe8 »
2008-11-30 Simplified installation instructions.
65 These commands will install the latest released version of gitit.
89725fd9 »
2008-11-06 Initial commit.
66 To install a version of gitit checked out from the repository,
67 change to the gitit directory and type:
68
69 cabal install
70
71 The `cabal` tool will automatically install all of the required haskell
72 libraries. If all goes well, by the end of this process, the latest
73 release of gitit will be installed in your local `.cabal` directory. You
74 can check this by trying:
75
76 gitit --version
77
78 If that doesn't work, check to see that `gitit` is in your local
79 cabal-install executable directory (usually `~/.cabal/bin`). And make
80 sure `~/.cabal/bin` is in your system path.
81
97e00433 » John MacFarlane
2009-04-18 Improved README.
82 Optional syntax highlighting support
83 ------------------------------------
84
85 If pandoc was compiled with optional syntax highlighting support,
86 this will be available in gitit too. This feature is recommended
87 if you plan to display source code on your wiki.
88
89 Highlighting support requires the [pcre][] library, so make sure that
90 is installed before continuing.
91
92 [pcre]: http://www.pcre.org/
93
94 To install gitit with highlighting support, first ensure that pandoc
95 is compiled with highlighting support, then install gitit as above:
96
97 cabal install pandoc -fhighlighting --reinstall
98 cabal install gitit
99
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
100 Running gitit
101 -------------
89725fd9 »
2008-11-06 Initial commit.
102
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
103 To run gitit, you'll need `git` in your system path. (Or `darcs` or
104 `hg`, if you're using darcs or mercurial to store the wiki data.)
89725fd9 »
2008-11-06 Initial commit.
105
97e00433 » John MacFarlane
2009-04-18 Improved README.
106 Gitit assumes that the page files (stored in the git repository) are
107 encoded as UTF-8. Even page names may be UTF-8 if the file system
108 supports this. So you should make sure that you are using a UTF-8 locale
109 when running gitit. (To check this, type `locale`.)
73db5a1f »
2009-01-28 Noted need for UTF-8 locale in README.
110
f8ab67e6 »
2009-04-27 Reformatting (line lengths) of README.
111 Switch to the directory where you want to run gitit. This should be a
f1f023a5 »
2009-07-09 Use nested templates in templates/ directory rather than template.html.
112 directory where you have write access, since three directories, `static`,
113 `templates`, and `wikidata`, and two files, `gitit-users` and `gitit.log`,
114 will be created here. To start gitit, just type:
89725fd9 »
2008-11-06 Initial commit.
115
116 gitit
117
118 If all goes well, gitit will do the following:
119
120 1. Create a git repository, `wikidata`, and add a default front page.
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
121 2. Create a `static` directory containing files to be treated as
122 static files by gitit.
f1f023a5 »
2009-07-09 Use nested templates in templates/ directory rather than template.html.
123 3. Create a `templates` directory containing HStringTemplate templates
f498fc6d »
2008-11-26 Use HStringTemplate template for pages.
124 for wiki pages.
125 4. Start a web server on port 5001.
89725fd9 »
2008-11-06 Initial commit.
126
f8ab67e6 »
2009-04-27 Reformatting (line lengths) of README.
127 Check that it worked: open a web browser and go to
128 <http://localhost:5001>.
97e00433 » John MacFarlane
2009-04-18 Improved README.
129
bf28dcbc » John MacFarlane
2010-01-21 README: added note about -p and -h options.
130 You can control the port that gitit runs on using the `-p` option:
6064190e »
2010-02-19 Fixed markdown error in README.
131 `gitit -p 4000` will start gitit on port 4000. Additional runtime
bf28dcbc » John MacFarlane
2010-01-21 README: added note about -p and -h options.
132 options are described by `gitit -h`.
133
7fa73832 »
2009-06-28 Updated README with information about metadata block.
134 Using gitit
135 ===========
136
97e00433 » John MacFarlane
2009-04-18 Improved README.
137 Wiki links and formatting
138 -------------------------
139
140 For instructions on editing pages and creating links, see the "Help" page.
141
f8ab67e6 »
2009-04-27 Reformatting (line lengths) of README.
142 Gitit interprets links with empty URLs as wikilinks. Thus, in markdown
143 pages, `[Front Page]()` creates an internal wikilink to the page `Front
144 Page`. In reStructuredText pages, `` `Front Page <>`_ `` has the same
145 effect.
89725fd9 »
2008-11-06 Initial commit.
146
c332b942 »
2009-05-10 Documentation changes for new index link format.
147 If you want to link to a directory listing for a subdirectory, use a
148 trailing slash: `[foo/bar/]()` creates a link to the directory for
149 `foo/bar`.
150
7fa73832 »
2009-06-28 Updated README with information about metadata block.
151 Page metadata
152 -------------
153
154 Pages may optionally begin with a metadata block. Here is an example:
155
38209d92 »
2009-07-03 Updated README with new metadata format.
156 ---
157 format: latex+lhs
158 categories: haskell math
159 toc: no
160 title: Haskell and
7fa73832 »
2009-06-28 Updated README with information about metadata block.
161 Category Theory
38209d92 »
2009-07-03 Updated README with new metadata format.
162 ...
7fa73832 »
2009-06-28 Updated README with information about metadata block.
163
164 \section{Why Category Theory?}
165
d89590a6 »
2009-08-17 Don't require blank line after metadata block.
166 The metadata block consists of a list of key-value pairs, each on a
167 separate line. If needed, the value can be continued on one or more
168 additional line, which must begin with a space. (This is illustrated by
169 the "title" example above.) The metadata block must begin with a line
170 `---` and end with a line `...` optionally followed by one or more blank
171 lines. (The metadata block is a valid YAML document, though not all YAML
172 documents will be valid metadata blocks.)
7fa73832 »
2009-06-28 Updated README with information about metadata block.
173
174 Currently the following keys are supported:
175
176 format
177 : Overrides the default page type as specified in the configuration file.
178 Possible values are `markdown`, `rst`, `latex`, `html`, `markdown+lhs`,
179 `rst+lhs`, `latex+lhs`. (Capitalization is ignored, so you can also
180 use `LaTeX`, `HTML`, etc.) The `+lhs` variants indicate that the page
181 is to be interpreted as literate Haskell. If this field is missing,
182 the default page type will be used.
183
184 categories
185 : A space or comma separated list of categories to which the page belongs.
186
187 toc
188 : Overrides default setting for table-of-contents in the configuration file.
189 Values can be `yes`, `no`, `true`, or `false` (capitalization is ignored).
190
191 title
192 : By default the displayed page title is the page name. This metadata element
193 overrides that default.
194
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
195 Highlighted source code
196 -----------------------
197
198 If gitit was compiled against a version of pandoc that has highlighting
199 support (see above), you can get highlighted source code by using
200 [delimited code blocks][]:
201
202 ~~~ {.haskell .numberLines}
203 qsort [] = []
204 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
205 qsort (filter (>= x) xs)
206 ~~~
207
4ff0a583 »
2009-09-24 Small documentation improvement suggested by joee.
208 To see what languages your pandoc was compiled to highlight:
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
209
210 pandoc -v
211
212 [delimited code blocks]: http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks
213
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
214 Configuring and customizing gitit
215 =================================
488e6bbc » John MacFarlane
2009-04-18 README: Added instructions for proxying with apache.
216
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
217 Configuration options
218 ---------------------
89725fd9 »
2008-11-06 Initial commit.
219
fe77c93f » John MacFarlane
2010-01-21 README: Clarified use of -f option.
220 Use the option `-f [filename]` to specify a configuration file:
ce07825b »
2009-04-12 Added data/default.conf, which defines default config file values.
221
fe77c93f » John MacFarlane
2010-01-21 README: Clarified use of -f option.
222 gitit -f my.conf
223
224 If this option is not used, gitit will use a default configuration.
225 To get a copy of the default configuration file, which you
226 can customize, just type:
227
228 gitit --print-default-config > my.conf
ce07825b »
2009-04-12 Added data/default.conf, which defines default config file values.
229
230 The default configuration file is documented with comments throughout.
2859d1b4 »
2009-02-10 Document --print-default-config.
231
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
232 The `static` directory
233 ----------------------
89725fd9 »
2008-11-06 Initial commit.
234
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
235 On receiving a request, gitit always looks first in the `static`
236 directory (or in whatever directory is specified for `static-dir` in
237 the configuration file). If a file corresponding to the request is
238 found there, it is served immediately. If the file is not found in
239 `static`, gitit next looks in the `static` subdirectory of gitit's data
240 file (`$CABALDIR/share/gitit-x.y.z/data`). This is where default css,
241 images, and javascripts are stored. If the file is not found there
242 either, gitit treats the request as a request for a wiki page or wiki
243 command.
244
245 So, you can throw anything you want to be served statically (for
246 example, a `robots.txt` file or `favicon.ico`) in the `static`
247 directory. You can override any of gitit's default css, javascript, or
248 image files by putting a file with the same relative path in `static`.
2473f078 »
2009-08-22 Added robots.txt to static.
249 Note that gitit has a default `robots.txt` file that excludes all
250 URLs beginning with `/_`.
89725fd9 »
2008-11-06 Initial commit.
251
77d20a35 »
2009-04-27 README changes: running with darcs, updated some refs to config options.
252 Note: if you set `static-dir` to be a subdirectory of `repository-path`,
89e0a04b »
2009-01-16 Added note about possibility of putting static inside repository.
253 and then add the files in the static directory to your repository, you
254 can ensure that others who clone your wiki repository get these files
255 as well. It will not be possible to modify these files using the web
256 interface, but they will be modifiable via git.
257
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
258 Using a VCS other than git
77d20a35 »
2009-04-27 README changes: running with darcs, updated some refs to config options.
259 --------------------------
260
261 By default, gitit will store wiki pages in a git repository in the
262 `wikidata` directory. If you'd prefer to use darcs instead of git,
263 you need to add the following field to the configuration file:
264
265 repository-type: Darcs
266
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
267 If you'd prefer to use mercurial, add:
268
269 repository-type: Mercurial
270
77d20a35 »
2009-04-27 README changes: running with darcs, updated some refs to config options.
271 This program may be called "darcsit" instead of "gitit" when a darcs
272 backend is used.
273
99d1199f »
2009-08-15 Added comments on filestore/maxcount to darcs sec of README.
274 Note: we recommend that you use gitit/darcsit with darcs version
275 2.3.0 or greater. If you must use an older version of darcs, then
276 you need to compile the filestore library without the (default)
277 maxcount flag, before (re)installing gitit:
278
279 cabal install --reinstall filestore -f-maxcount
280 cabal install --reinstall gitit
281
282 Otherwise you will get an error when you attempt to access your
283 repository.
284
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
285 Changing the theme
286 ------------------
89725fd9 »
2008-11-06 Initial commit.
287
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
288 To change the look of the wiki, you can modify `custom.css` in
289 `static/css`.
97e00433 » John MacFarlane
2009-04-18 Improved README.
290
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
291 To change the look of printed pages, copy gitit's default `print.css`
292 to `static/css` and modify it.
97e00433 » John MacFarlane
2009-04-18 Improved README.
293
f498fc6d »
2008-11-26 Use HStringTemplate template for pages.
294 The logo picture can be changed by copying a new PNG file to
ab55bfb6 »
2012-04-20 Indicate size of default logo picture. Closes #291.
295 `static/img/logo.png`. The default logo is 138x155 pixels.
97e00433 » John MacFarlane
2009-04-18 Improved README.
296
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
297 To change the footer, modify `templates/footer.st`.
298
299 For more radical changes, you can override any of the default
aeeb91ef » Chris Eidhof
2010-08-22 Templates are in data directory
300 templates in `$CABALDIR/share/gitit-x.y.z/data/templates` by copying
d77f5663 »
2009-08-22 Updated README.markdown for changes to static and templates.
301 the file into `templates` and modifying it. The `page.st` template is
302 the master template; it includes the others. Interpolated variables are
303 surrounded by `$`s, so `literal $` must be backslash-escaped.
89725fd9 »
2008-11-06 Initial commit.
304
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
305 Adding support for math
306 -----------------------
89725fd9 »
2008-11-06 Initial commit.
307
7fa73832 »
2009-06-28 Updated README with information about metadata block.
308 To write math on a markdown-formatted wiki page, just enclose it
309 in dollar signs, as in LaTeX:
89725fd9 »
2008-11-06 Initial commit.
310
311 Here is a formula: $\frac{1}{\sqrt{c^2}}$
312
313 You can write display math by enclosing it in double dollar signs:
314
315 $$\frac{1}{\sqrt{c^2}}$$
316
ff6f3b95 »
2009-08-23 Updated math part of README.
317 Gitit can display TeX math in three different ways, depending on the
318 setting of `math` in the configuration file:
319
320 1. `mathml` (default): Math will be converted to MathML using
321 [texmath][]. This method works with IE+mathplayer, Firefox, and
322 Opera, but not Safari.
323
324 2. `jsMath`: Math will be rendered using the [jsMath][] javascript.
325 If you want to use this method, download `jsMath` and `jsMath
326 Image Fonts` from the [jsMath download page][]. You'll have two
327 `.zip` archives. Unzip them both in the `static/js` directory (a new
328 subdirectory, `jsMath`, will be created). This works with all
329 browsers, but is slower and not as nice looking as MathML.
330
331 3. `raw`: Math will be rendered as raw LaTeX codes.
332
6a6388be » pvorb
2012-07-17 Fix some minor issues in README
333 [jsMath]: http://www.math.union.edu/~dpvc/jsmath/
89725fd9 »
2008-11-06 Initial commit.
334 [jsMath download page]: http://sourceforge.net/project/showfiles.php?group_id=172663
335
a9e422b6 »
2012-04-20 Added a README section on restricting access. Closes #292.
336 Restricting access
337 ------------------
338
339 If you want to limit account creation on your wiki, the easiest way to do this
340 is to provide an `access-question` in your configuration file. (See the commented
341 default configuration file.) Nobody will be able to create an account without
342 knowing the answer to the access question.
343
344 Another approach is to use HTTP authentication. (See the config file comments on
345 `authentication-method`.)
346
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
347 Plugins
348 =======
89725fd9 »
2008-11-06 Initial commit.
349
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
350 Plugins are small Haskell programs that transform a wiki page after it
351 has been converted from Markdown or RST. See the example plugins in the
352 `plugins` directory. To enable a plugin, include the path to the plugin
353 (or its module name) in the `plugins` field of the configuration file.
354 (If the plugin name starts with `Network.Gitit.Plugin.`, gitit will assume that
355 the plugin is an installed module and will not look for a source file.)
89725fd9 »
2008-11-06 Initial commit.
356
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
357 Plugin support is enabled by default. However, plugin support makes
358 the gitit executable considerably larger and more memory-hungry.
359 If you don't need plugins, you may want to compile gitit without plugin
360 support. To do this, unset the `plugins` Cabal flag:
89725fd9 »
2008-11-06 Initial commit.
361
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
362 cabal install --reinstall gitit -f-plugins
89725fd9 »
2008-11-06 Initial commit.
363
e9ac5c2b »
2009-08-15 Make plugins flag enabled by default.
364 Note also that if you compile gitit for executable profiling, attempts
365 to load plugins will result in "internal error: PAP object entered!"
89725fd9 »
2008-11-06 Initial commit.
366
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
367 Accessing the wiki through git
368 ==============================
89725fd9 »
2008-11-06 Initial commit.
369
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
370 All the pages and uploaded files are stored in a git repository. By
371 default, this lives in the `wikidata` directory (though this can be
372 changed through configuration options). So you can interact with the
373 wiki using git command line tools:
89725fd9 »
2008-11-06 Initial commit.
374
375 git clone ssh://my.server.edu/path/of/wiki/wikidata
376 cd wikidata
377 vim Front\ Page.page # edit the page
378 git commit -m "Added message about wiki etiquette" Front\ Page.page
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
379 git push
89725fd9 »
2008-11-06 Initial commit.
380
381 If you now look at the Front Page on the wiki, you should see your changes
382 reflected there. Note that the pages all have the extension `.page`.
383
13b66f49 »
2009-12-12 Added support for the new mercurial filestore backend.
384 If you are using the darcs or mercurial backend, the commands will
385 be slightly different. See the documentation for your VCS for
386 details.
387
53fb6c20 »
2010-02-21 Added notes on PDF caching and idle
388 Performance
389 ===========
390
f22d5c4a »
2009-08-14 Changed default config to use-cache: no.
391 Caching
53fb6c20 »
2010-02-21 Added notes on PDF caching and idle
392 -------
f22d5c4a »
2009-08-14 Changed default config to use-cache: no.
393
394 By default, gitit does not cache content. If your wiki receives a lot of
395 traffic or contains pages that are slow to render, you may want to activate
396 caching. To do this, set the configuration option `use-cache` to `yes`.
53fb6c20 »
2010-02-21 Added notes on PDF caching and idle
397 By default, rendered pages, highlighted source files, and exported PDFs
398 will be cached in the `cache` directory. (Another directory can be
399 specified by setting the `cache-dir` configuration option.)
f22d5c4a »
2009-08-14 Changed default config to use-cache: no.
400
401 Cached pages are updated when pages are modified using the web
402 interface. They are not updated when pages are modified directly through
403 git or darcs. However, the cache can be refreshed manually by pressing
404 Ctrl-R when viewing a page, or by sending an HTTP GET or POST request to
405 `/_expire/path/to/page`, where `path/to/page` is the name of the page to
406 be expired.
407
408 Users who frequently update pages using git or darcs may wish to add a
409 hook to the repository that makes the appropriate HTTP request to expire
410 pages when they are updated. To facilitate such hooks, the gitit cabal
411 package includes an executable `expireGititCache`. Assuming you are
412 running gitit at port 5001 on localhost, and the environment variable
413 `CHANGED_FILES` contains a list of the files that have changed, you can
414 expire their cached versions using
415
416 expireGititCache http://localhost:5001 $CHANGED_FILES
417
418 Or you can specify the files directly:
419
420 expireGititCache http://localhost:5001 "Front Page.page" foo/bar/baz.c
421
422 This program will return a success status (0) if the page has been
423 successfully expired (or if it was never cached in the first place),
424 and a failure status (> 0) otherwise.
425
426 The cache is persistent through restarts of gitit. To expire all cached
427 pages, simply remove the `cache` directory.
428
53fb6c20 »
2010-02-21 Added notes on PDF caching and idle
429 Idle
430 ----
431
432 By default, GHC's runtime will repeatedly attempt to collect garbage
433 when an executable like Gitit is idle. This means that gitit will, after
434 the first page request, never use 0% CPU time and sleep, but will use
435 ~1%. This can be bad for battery life, among other things.
436
437 To fix this, one can disable the idle-time GC with the runtime flag
438 `-I0`:
439
440 gitit -f my.conf +RTS -I0 -RTS
441
488e6bbc » John MacFarlane
2009-04-18 README: Added instructions for proxying with apache.
442 Using gitit with apache
443 =======================
444
445 Most users who run a public-facing gitit will want gitit to appear
446 at a nice URL like `http://wiki.mysite.com` or
447 `http://mysite.com/wiki` rather than `http://mysite.com:5001`.
448 This can be achieved using apache's `mod_proxy`.
449
450 Proxying to `http://wiki.mysite.com`
451 ------------------------------------
452
453 Set up your DNS so that `http://wiki.mysite.com` maps to
454 your server's IP address. Make sure that the `mod_proxy` module is
455 loaded, and set up a virtual host with the following configuration:
456
457 <VirtualHost *>
458 ServerName wiki.mysite.com
459 DocumentRoot /var/www/
460 RewriteEngine On
461 ProxyPreserveHost On
462 ProxyRequests Off
463
464 <Proxy *>
465 Order deny,allow
466 Allow from all
467 </Proxy>
468
469 ProxyPassReverse / http://127.0.0.1:5001
470 RewriteRule ^(.*) http://127.0.0.1:5001$1 [P]
471
472 ErrorLog /var/log/apache2/error.log
473 LogLevel warn
474
475 CustomLog /var/log/apache2/access.log combined
476 ServerSignature On
477
478 </VirtualHost>
479
480 Reload your apache configuration and you should be all set.
481
5690cd59 » fs111
2012-06-19 added nginx example for proxy setup
482 Using nginx to achieve the same
483 -------------------------------
8b14a550 »
2012-06-25 Minor style edits to nginx instructions.
484
485 Drop a file called `wiki.example.com.conf` into `/etc/nginx/conf.d`
486 (or where ever your distribution puts it).
5690cd59 » fs111
2012-06-19 added nginx example for proxy setup
487
488 server {
489 listen 80;
490 server_name wiki.example.com
491 location / {
492 proxy_pass http://127.0.0.1:5001/;
493 proxy_set_header X-Real-IP $remote_addr;
494 proxy_redirect off;
495 }
496 access_log /var/log/nginx/wiki.example.com.log main;
497 }
498
8b14a550 »
2012-06-25 Minor style edits to nginx instructions.
499 Reload your nginx config and you should be all set.
5690cd59 » fs111
2012-06-19 added nginx example for proxy setup
500
501
488e6bbc » John MacFarlane
2009-04-18 README: Added instructions for proxying with apache.
502 Proxying to `http://mysite.com/wiki`
503 ------------------------------------
504
505 Make sure the `mod_proxy`, `mod_headers`, `mod_proxy_http`,
506 and `mod_proxy_html` modules are loaded. `mod_proxy_html`
507 is an external module, which can be obtained [here]
508 (http://apache.webthing.com/mod_proxy_html/). It rewrites URLs that
509 occur in web pages. Here we will use it to rewrite gitit's links so that
510 they all begin with `/wiki/`.
511
f8ab67e6 »
2009-04-27 Reformatting (line lengths) of README.
512 First, tell gitit not to compress pages, since `mod_proxy_html` needs
513 uncompressed pages to parse. You can do this by setting the gitit
514 configuration option
488e6bbc » John MacFarlane
2009-04-18 README: Added instructions for proxying with apache.
515
77d20a35 »
2009-04-27 README changes: running with darcs, updated some refs to config options.
516 compress-responses: no
517
518 Second, modify the link in the `reset-password-message` in the
519 configuration file: instead of
520
521 http://$hostname$:$port$$resetlink$
522
523 set it to
524
525 http://$hostname$/wiki$resetlink$
488e6bbc » John MacFarlane
2009-04-18 README: Added instructions for proxying with apache.
526
527 Restart gitit.
528
529 Now add the following lines to the apache configuration file for the
530 `mysite.com` server:
531
532 # These commands will proxy /wiki/ to port 5001
533
534 ProxyRequests Off
535
536 <Proxy *>
537 Order deny,allow
538 Allow from all
539 </Proxy>
540
541 ProxyPass /wiki/ http://127.0.0.1:5001/
542
543 <Location /wiki/>
544 SetOutputFilter proxy-html
545 ProxyPassReverse /
546 ProxyHTMLURLMap / /wiki/
547 RequestHeader unset Accept-Encoding
548 </Location>
549
550 Reload your apache configuration and you should be set.
551
552 For further information on the use of `mod_proxy_http` to rewrite URLs,
553 see the [`mod_proxy_html` guide].
554
555 [`mod_proxy_html` guide]: http://apache.webthing.com/mod_proxy_html/guide.html
556
e86d3dce »
2009-06-24 Added note on using gitit as a library to README.
557 Using gitit as a library
558 ========================
559
560 By importing the module `Network.Gitit`, you can include a gitit wiki
561 (or several of them) in another happstack application. There are some
562 simple examples in the haddock documentation for `Network.Gitit`.
563
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
564 Reporting bugs
565 ==============
89725fd9 »
2008-11-06 Initial commit.
566
a49ba22c »
2008-12-07 Added link to bug tracker on googlecode.
567 Bugs may be reported (and feature requests filed) at
568 <http://code.google.com/p/gitit/issues/list>.
89725fd9 »
2008-11-06 Initial commit.
569
41595eea »
2009-07-12 Added notice of mailing list to README.
570 There is a mailing list for users and developers at
571 <http://groups.google.com/group/gitit-discuss>.
572
45a9c7fb »
2008-11-07 Reformatted README using standard markdown.
573 Acknowledgements
574 ================
89725fd9 »
2008-11-06 Initial commit.
575
bb8abc3a »
2009-04-27 Improved acknowledgements, bringing list of contributors up to date.
576 A number of people have contributed patches:
577
8500b29a »
2009-04-27 More contributors.
578 - Gwern Branwen helped to optimize gitit and wrote the
f22d5c4a »
2009-08-14 Changed default config to use-cache: no.
579 InterwikiPlugin. He also helped with the Feed module.
bb8abc3a »
2009-04-27 Improved acknowledgements, bringing list of contributors up to date.
580 - Simon Michael contributed the patch adding RST support.
581 - Henry Laxen added support for password resets and helped with
582 the apache proxy instructions.
583 - Anton van Straaten made the process of page generation
584 more modular by adding Gitit.ContentTransformer.
058ce025 »
2009-07-09 Acknowledge Robin Green's patch in README.
585 - Robin Green helped improve the plugin API and interface, and
586 fixed a security problem with the reset password code.
edeca79e » John MacFarlane
2009-04-27 More acknowledgements.
587 - Thomas Hartman helped improve the index page, making directory
312b9dcd » John MacFarlane
2009-10-23 Added acknowledgements to README.
588 browsing persistent, and fixed a bug in template recompilation.
bb8abc3a »
2009-04-27 Improved acknowledgements, bringing list of contributors up to date.
589 - Justin Bogner improved the appearance of the preview button.
8500b29a »
2009-04-27 More contributors.
590 - Kohei Ozaki contributed the ImgTexPlugin.
312b9dcd » John MacFarlane
2009-10-23 Added acknowledgements to README.
591 - Michael Terepeta improved validation of change descriptions.
cf6e15e1 »
2009-06-24 Added acknowledgement for mightybyte.
592 - mightybyte suggested making gitit available as a library,
593 and contributed a patch to ifLoggedIn that was needed to
594 make gitit usable with a custom authentication scheme.
bb8abc3a »
2009-04-27 Improved acknowledgements, bringing list of contributors up to date.
595
b8bf0817 »
2009-08-23 Added thanks to darcs team in README.
596 I am especially grateful to the darcs team for using darcsit for
597 their public-facing wiki. This has helped immensely in identifying
598 issues and improving performance.
599
bb8abc3a »
2009-04-27 Improved acknowledgements, bringing list of contributors up to date.
600 Gitit's default visual layout is shamelessly borrowed from Wikipedia.
5c5c3374 »
2008-11-22 Updated README.
601 The stylesheets are influenced by Wikipedia's stylesheets and by the
602 bluetrip CSS framework (see BLUETRIP-LICENSE). Some of the icons in
603 `img/icons` come from bluetrip as well.
604
Something went wrong with that request. Please try again.