Install Instiki in Apache using FastCGI
The first step, is, of course, to download the Instiki tarball package in http://rubyforge.org/projects/instiki/. The most recent version available for now is 0.11.
As usual, we untar the package, renaming the directory to instiki:
persefone:/var/www# tar xvfz instiki-0.11.0.tgz
persefone:/var/www# mv instiki-0.11.0 instiki
Set up the permissions for the apache user:
persefone:/var/www# chown www-data:www-data instiki/ -R
On instiki/public, we need to edit the first line of the dispatch.fcgi file, changing:
#!c:/ruby/bin/ruby
with:
#!/usr/bin/ruby (the most common place where the ruby binary is located)
We will also need to modify the .htaccess file in the same directory. You'll have to search for the line:
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
replacing it with:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
If you use mod-fcgid instead of mod-fastcgi, you will have to change the following line too, in .htaccess:
AddHandler fastcgi-script .fcgi
replacing it with:
AddHandler fcgid-script .fcgi
We should define a MySQL database too (by default sqlite will be used), editing database.yml under instiki/config
production:
adapter: mysql
host: localhost
database: instiki
username: instiki
password: myinstikipassword
socket: /var/run/mysqld/mysqld.sock
We usually will set up a new hostname for the wiki
persefone:/etc/apache2/sites-available# vim wiki.example.com
<Directory /var/www/instiki/public>
Allow from all
AllowOverride all
</Directory>
<VirtualHost *>
ServerName wiki.example.com
DocumentRoot /var/www/instiki/public/
</VirtualHost>
And we enable it making a symbolic link from sites-available to sites-enabled
persefone:~# ln -s /etc/apache2/sites-available/wiki.example.com /etc/apache2/sites-enabled/
Under the Instiki directory, we will generate the initial database with the following command (RAILS_ENV=production tells rake to generate the production database) :
persefone:/var/www/instiki# RAILS_ENV=production rake migrate
We can now reload Apache2 and Instiki should be working.



