Install Instiki in Apache using FastCGI

Instiki is a Wiki clone made in Ruby on Rails really easy to setup and use. However, the installation manuals on the Instiki page are based in using WEBrick and not Apache.

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.



 


Trackback

Trackback URL for this entry:
http://www.gra2.com/trackback.php/install-instiki-in-apache-using-fastcgi

No trackback comments for this entry.

Comments

Post a comment

thanks for this. one thing i recommend as well, is to make sure that you run ./instiki (instead of ./script/server) and make sure everything works this way first before running dispatch.fcgi.  Also make sure you can run ruby dispatch.fcgi from the command line as well first .. (for debugging purposes)

Anonymous on Tuesday, May 22 2007 @ 07:03 AM CEST Reply | #

in.solit.us  doesn't work at all !!!!    this is an advice for the webmasters of in.solit.us !!!!

it doesn't load and throws away somethin' like this :

Application Error Aieeeee! This action or controller has crashed the web application. You may have found a bug. Please contact us providing as much information as possible about the error. Additionally, you can use our Forums to post about the problem.

NOTHIN' WOKS !!!  PLS TAKE A LOOK !!!

AVISO A LOS CREADORES DE in.solit.us   nada funciona al cargar la pagina y aparece el error arriba mencionado.  Favor échenle un vistazo...... tengo info y musica en su servidor..... gracias

Anonymous on Friday, October 19 2007 @ 08:50 PM CEST Reply | #

Thanks a lot for the tip. Should be working now.

---
www.gra2.com
in.solit.us: Upload and share your files

daniel on Friday, October 19 2007 @ 10:28 PM CEST Reply | #

Search



About

newton.gra2.com is a blog about technology, opinion and random thoughts written by Daniel Alvarez, a computer engineer currently living in Zurich, Switzerland.

Topics

News (20/0)
Manuals (24/0)
Security (7/0)
Music (3/0)
Weeklog (1/0)
Personal (34/0)
Photos (3/0)
Opinion (14/0)
Windows (5/0)

Blogroll

Pros i contres (Jordi)
Entrepa de fusta (Oriol)
Spaghetti Code (Isaac)
Made in net (Eric)
Nogare (Juan)
Blog de Isaac Jimenez
Web d'en Jaume Benet
Montcada Wireless (Fran)
Blog d'en Ricard Forniol
Angela Fabregues
in.solit.us

Libertad Digital
FOX News
The Wall Street Journal
The Washington Times
The Jerusalem Post

Michelle Malkin
Eurabian News
Nihil Obstat
Barcepundit
Expose the left
Davids Medienkritik
Johan Norberg
Ayaan Hirsi Ali

User Functions

:

:


Lost your password?

Latest posts

Stories

No new stories

Comments last 2 days

No new comments

Trackbacks last 2 days

No new trackback comments

Links last 2 weeks

No recent new links