]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/amazon_s3.mdwn
ikiwiki (3.20140916) unstable; urgency=low
[ikiwiki.git] / doc / plugins / amazon_s3.mdwn
1 [[!template id=plugin name=amazon_s3 author="[[Joey]]"]]
2 [[!tag type/special-purpose]]
3
4 This plugin allows ikiwiki to publish a wiki in the [Amazon Simple Storage
5 Service](http://aws.amazon.com/s3) (S3). As pages are rendered, ikiwiki
6 will upload them to Amazon S3. The entire wiki contents, aside from the
7 ikiwiki CGI, can then be served directly out of Amazon S3.
8
9 You'll need the [[!cpan Net::Amazon::S3]] and [[!cpan File::MimeInfo]] perl
10 modules and an Amazon S3 account to use this plugin.
11
12 ## configuration
13
14 This plugin uses the following settings in the setup file:
15
16 * `amazon_s3_key_id` - Set to your public access key id.
17 * `amazon_s3_key_file` - Set to the name of a file where you have
18   stored your secret access key. The content of this file *must*
19   be kept secret.
20 * `amazon_s3_bucket` - The globally unique name of the bucket to use to
21   store the wiki. This determines the URL to your wiki. For example, if you
22   set it to "foo", then the url will be
23   "http://foo.s3.amazonaws.com/wiki/".
24 * `amazon_s3_prefix` - A prefix to prepend to each page name.
25   The default is "wiki/". Note: In order to host your site at the root,
26   it needs to be set to "", and you'll have to 
27   [read this](http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html)
28   for details about configuring your S3 bucket as a website.
29 * `amazon_s3_location` - Optionally, this can be set to control which
30   datacenter to use. For example, set it to "EU" to for Europe.
31 * `amazon_s3_dupindex` - Normally, when `usedirs` is enabled,
32   "foo/index.html" is stored in S3 as a key named "foo/", and all links
33   between pages use that name. If you also needs links that include
34   "index.html" in their names to work, you can enable this option. Then
35   each index.html file will be stored in S3 *twice*, under both names. This
36   will use more disk and bandwidth, and is not recommended unless you really
37   need it for some reason. These days, it's probably better to configure
38   your S3 bucket as a website.
39
40 Note that you should still set `destdir` in the setup file. The files that
41 are uploaded to Amazon S3 will still be written to the destdir, too.
42
43 Likewise, you will probably want to set the `url` in the setup file.
44 The url can use the `foo.s3.amazonaws.com` domain name, or another domain
45 name that is a CNAME for it.
46
47 The `hardlink` config file setting is not compatible with this plugin.
48
49 ## data transfer notes
50
51 If you run 'ikiwiki -setup my.setup' to force a rebuild of your wiki, the
52 entire thing will be re-uploaded to Amazon S3. This will take time, and
53 cost you money, so it should be avoided as much as possible.
54
55 If you run 'ikiwiki -setup my.setup -refresh', ikiwiki will only upload the
56 modified pages that it refreshes. Faster and cheaper. Still, if you have
57 very large pages (for example, a page that inlines hundreds of other pages
58 .. or is just very large), the complete page contents will be re-uploaded
59 each time it's changed. Amazon S3 does not currently support partial/rsync
60 type uploads.
61
62 Copy and rename detection is not done, so if you copy or rename a large file,
63 it will be re-uploaded, rather than copied.
64
65 ## deleting a bucket
66
67 You can use "ikiwiki -setup my.setup --delete-bucket" to delete anything
68 that's in the configured bucket, and remove the bucket.