enhancesments for shared hosting
[ikiwiki.git] / doc / tips / nearlyfreespeech.mdwn
1 [NearlyFreeSpeech.net](http://NearlyFreeSpeech.net) is a shared hosting
2 provider with very cheap pay as you go pricing. Here's how to install ikiwiki
3 there if you don't have a dedicated server.
4
5 * [Get an account](https://www.nearlyfreespeech.net/about/start.php).
6 * Create a site using their web interface. Mine is named `ikiwiki-test` and I
7   used their DNS instead of getting my own, resulting in
8   <http://ikiwiki-test.nfshost.com/>
9 * Fund it. (Or don't. They gave me 2 cents free funding for signing up, which
10   is enough to pay for 10 megabytes of hosting, or about a thousand typical 
11   page views at their current rates.)
12 * `ssh` into their server using the ssh hostname and username displayed on
13   the site's information page. For me this was
14   `ssh joeyh_ikiwiki-test@ssh.phx.nearlyfreespeech.net`
15 * Set up .profile to use your home directory.
16         echo "PATH=$PATH:$HOME/bin" > $HOME/.profile
17         . $HOME/.profile
18 * You'll be in the htdocs directory by default, where public web pages are
19   put, so before installing ikiwiki, `cd $HOME`
20 * Use `wget` to [[download]] the ikiwiki tarball.
21 * Unpack ikiwiki.
22         tar zxvf ikiwiki*.tar.gz
23 * Use CPAN to install the perl modules it uses into your home directory:
24         PERL5LIB=ikiwiki:ikiwiki/cpan:. PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->install("Bundle::IkiWiki")'
25         PERL5LIB=ikiwiki:ikiwiki/cpan:. PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->force(install => "Bundle::IkiWiki::Extras")'
26   (This will take a while. As long as the first command succeeds, ikiwiki will be
27   usable. The second command adds extra modules that some plugins use, and
28   installation of some of them might fail.)
29 * Now build and install ikiwiki into your home directory.
30         cd ikiwiki
31         export MAKE=gmake
32         perl Makefile.PL INSTALL_BASE=$HOME PREFIX=
33         $MAKE
34         $MAKE install
35 * With ikiwiki installed, you can follow the regular [[setup]] tutorial for
36   settng up your wiki. Make sure to set `destdir` to `/home/htdocs/` so that
37   the wiki is published on the web site. I recommend using git for revision
38   control; you can then clone your wiki's git repository as an offsite backup.
39   Here is an example of how I set up a wiki:
40         mkdir ~/wiki
41         cd ~/wiki
42         cp ~/ikiwiki/doc/ikiwiki.setup .
43         cp -r ~/ikiwiki/doc/examples/blog/* .
44         nano ikiwiki.setup
45         # Set destdir to /home/htdocs
46         # Set srcdir to /home/private/wiki
47         # Set url to http://yoursite.nfshost.com/ , set cgiurl likewise
48         # Uncomment the `rcs => "git"` line, and the cgi and git
49         # post-update wrapper blocks.
50         # Set the cgi wrapper path to /home/htdocs/ikiwiki.cgi
51         # Set the git wrapper path to /home/private/wiki.git/hooks/post-update
52         # Configure the rest to your liking and save the file.
53         ikiwiki-makerepo git . ../wiki.git
54         ikiwiki -setup ikiwiki.setup
55 * Finally, you can save a _lot_ of disk space by cleaning up the ikiwiki
56   tarball and .cpan directory.
57         rm -rf ~/ikiwiki*.tar.gz ~/.cpan
58
59 Have fun and do good things. --[[Joey]]