]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/nearlyfreespeech.mdwn
more on cleanup
[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 ## Register for an account and set up a site
6
7 After you [get an account](https://www.nearlyfreespeech.net/about/start.php),
8 create a site using their web interface. 
9
10 Mine is named `ikiwiki-test` and I used their DNS instead of getting my
11 own, resulting in <http://ikiwiki-test.nfshost.com/>
12
13 They gave me 2 cents free funding for signing up, which is enough to pay
14 for 10 megabytes of hosting, or about a thousand typical page views at
15 their current rates. Plenty to decide if this is right for you. If it is,
16 $5 might be a good starting amount of money to put in your account.
17
18 ## ssh in and configure the environment
19
20 ssh into their server using the ssh hostname and username displayed on
21 the site's information page. For me this was:
22
23         ssh joeyh_ikiwiki-test@ssh.phx.nearlyfreespeech.net
24
25 Now set up .profile to run programs from ~/bin.
26
27         cd $HOME
28         echo "PATH=$PATH:$HOME/bin" > .profile
29         . .profile
30
31 ## Download an unpack ikiwiki
32
33 Use `wget` to [[download]] the ikiwiki tarball. Then unpack it:
34
35         tar zxvf ikiwiki*.tar.gz
36
37 ## Install perl modules
38
39 Use CPAN to install the perl modules it uses into your home directory:
40
41         PERL5LIB=ikiwiki:ikiwiki/cpan:. PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->install("Bundle::IkiWiki")'
42         PERL5LIB=ikiwiki:ikiwiki/cpan:. PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->force(install => "Bundle::IkiWiki::Extras")'
43
44 (This will take a while. As long as the first command succeeds, ikiwiki will be
45 usable. The second command adds extra modules that some plugins use, and
46 installation of some of them might fail.)
47
48 ## Build and install ikiwiki
49
50         cd ikiwiki
51         export MAKE=gmake
52         perl Makefile.PL INSTALL_BASE=$HOME PREFIX=
53         $MAKE
54         $MAKE install
55
56 ## Set up a wiki in the usual way
57
58 With ikiwiki installed, you can follow the regular [[setup]] tutorial for
59 settng up your wiki. Make sure to set `destdir` to `/home/htdocs/` so that
60 the wiki is published on the web site. I recommend using git for revision
61 control; you can then clone your wiki's git repository as an offsite backup.
62
63 Here is an example of how I set up a wiki:
64
65         mkdir ~/wiki
66         cd ~/wiki
67         cp ~/ikiwiki/doc/ikiwiki.setup .
68         cp -r ~/ikiwiki/doc/examples/blog/* .
69         nano ikiwiki.setup
70         # Set destdir to /home/htdocs
71         # Set srcdir to /home/private/wiki
72         # Set url to http://yoursite.nfshost.com/ , set cgiurl likewise
73         # Uncomment the `rcs => "git"` line, and the cgi and git
74         # post-update wrapper blocks.
75         # Set the cgi wrapper path to /home/htdocs/ikiwiki.cgi
76         # Set the git wrapper path to /home/private/wiki.git/hooks/post-update
77         # Configure the rest to your liking and save the file.
78         ikiwiki-makerepo git . ../wiki.git
79         ikiwiki -setup ikiwiki.setup
80
81 ## Clean up
82
83 Finally, you can save a _lot_ of disk space by cleaning up the ikiwiki
84 tarball and .cpan directory and a few other peices of cruft. Since you'll be
85 charged one cent per month per megabyte, this is a quick way to save several
86 dollars.
87
88 rm -rf ~/ikiwiki*.tar.gz ~/.cpan ~/ikiwiki ~/man ~/lib/perl5/5.8.8
89
90 That should cut things down to less than 4 megabytes. If you want to save
91 even more space, delete unused perl modules from ~/lib/perl5
92
93 ## Enjoy!
94
95 Have fun and do good things. --[[Joey]]