]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/nearlyfreespeech.mdwn
2d59aca7e0df7df55ad8f962fd3a0c25243bba91
[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 bandwidth, 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=`pwd`/ikiwiki:`pwd`/ikiwiki/cpan:`pwd`/lib/perl5 PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->install("Bundle::IkiWiki")'
42         
43         PERL5LIB=`pwd`/ikiwiki:`pwd`/ikiwiki/cpan:`pwd`/lib/perl5 PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->force(install => "Bundle::IkiWiki::Extras")'
44
45 This will take a while. As long as the first command succeeds, ikiwiki will be
46 usable. The second command adds extra modules that some plugins use, so it's
47 ok if installation of some of them fail.
48
49 ## Build and install ikiwiki
50
51         cd ikiwiki
52         export MAKE=gmake
53         perl Makefile.PL INSTALL_BASE=$HOME PREFIX=
54         $MAKE
55         $MAKE install
56
57 ## Set up a wiki in the usual way
58
59 With ikiwiki installed, you can follow the regular [[setup]] tutorial for
60 settng up your wiki. Make sure to set `destdir` to `/home/htdocs/` so that
61 the wiki is published on the web site. I recommend using git for revision
62 control; you can then clone your wiki's git repository as an offsite backup.
63
64 Here is an example of how I set up a wiki:
65
66         mkdir ~/wiki
67         cd ~/wiki
68         cp ~/ikiwiki/doc/ikiwiki.setup .
69         cp -r ~/ikiwiki/doc/examples/blog/* .
70         nano ikiwiki.setup
71         # Set destdir to /home/htdocs
72         # Set srcdir to /home/private/wiki
73         # Set url to http://yoursite.nfshost.com/ , set cgiurl likewise
74         # Uncomment the `rcs => "git"` line, and the cgi and git
75         # post-update wrapper blocks.
76         # Set the cgi wrapper path to /home/htdocs/ikiwiki.cgi
77         # Set the git wrapper path to /home/private/wiki.git/hooks/post-update
78         # Configure the rest to your liking and save the file.
79         ikiwiki-makerepo git . ../wiki.git
80         ikiwiki -setup ikiwiki.setup
81
82 ## Clean up
83
84 Finally, you can save a _lot_ of disk space by cleaning up the ikiwiki
85 tarball and .cpan directory and a few other peices of cruft. Since you'll be
86 charged one cent per month per megabyte, this is a quick way to save several
87 dollars.
88
89 rm -rf ~/ikiwiki*.tar.gz ~/.cpan ~/ikiwiki ~/man ~/lib/perl5/5.8.8
90
91 That should cut things down to less than 4 megabytes. If you want to save
92 even more space, delete unused perl modules from ~/lib/perl5
93
94 ## Enjoy!
95
96 Have fun and do good things. --[[Joey]]