Running Instiki on Dreamhost has gotten much easier since they have added Passenger (mod_rails).
Create a new fully hosted domain on dreamhost. Something like wiki.domain.com.This will create the wiki.domain.com folder in the user’s home directory. Login to your shell account and do the following:
cd wiki. yourdomain.com
svn checkout svn://rubyforge.org/var/svn/instiki/instiki/trunk/ instiki
cd instiki
rake db:migrate RAILS_ENV=production
Open wiki. yourdomain.com in your browser and set up the wiki.
Chuckle.
With Subversion:
svn co http://instiki.rubyforge.org/svn/instiki/trunk/ yourWebDirectory
OR
1. Download the source tarball from http://www.instiki.org
OR
2. Unpack it into your web directory
3. Rename it as instiki
You have the choice between the different backends supported by Rails : sqlite3, mysql, postgresql...
In this tutorial we will use sqlite3, which is the Instiki default. sqlite3 is bundled with Instiki, so you won’t need to install it separately. If you use sqlite3, you won’t need to change config/database.yml from the defaults.
Go to the root of the instiki directory, and type:
rake db:migrate RAILS_ENV=production
You should now have the production database created in the db directory.
Open public/.htaccess and change the following line :
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
to:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
Make sure you enabled FCGI in your Dreamhost domain settings.
In order to protect your database password (and other config information), you must prevent http access to directories other than public in the install tree. Do this in two steps:
.htaccess file in the Instiki root directory containing only Deny from allpublic/.htaccess, adding the phrase Allow from allThen you can edit the file public/dispatch.fcgi to add the following at the end of it (taken
from http://work.alexyoung.org/archives/102/dreamhost-and-rails-500-errors ) :
RailsFCGIHandler.process! nil, 10 class RailsFCGIHandler private def frao_handler(signal) dispatcher_log :info, "asked to terminate immediately" dispatcher_log :info, "frao handler working its magic!" restart_handler(signal) end alias_method :exit_now_handler, :frao_handler end
NOTE: I was able to get it to work on Dreamhost in production mode by adding this as the top line in environment.rb:
RAILS_ENV = ENV['RAILS_ENV'] || 'production'
You can do the following from the root of your installation directory in order to be sure to start Instiki in a clean environment :
touch public/* killall dispatch.fcgi rm -f /tmp/ruby_sess.*
Go to http://www.yourdomain.com/instiki/public/
You should see the Instiki Setup page.
I had to use PHP 4.4.7 setting in the Manage Domains area, as opposed to PHP 5.2.2. Also, i’m hosting this as a subdomain. ie: wiki.domain.com
ExportWhen I try to use the Export feature, I get a uninitialized constant error due to the presence of a test on OPTIONS[:pdflatex] in the export template. One dirty workaround is to delete this portion of the test by editing line 8 of app/views/wiki/export.rhtml to :
<% if @web.markup == :textile %>
Some extensions needed to produce the PDF export are missing on the Dreamhost server. The workaround is to edit the views app/views/wiki/tex.rhtml and app/views/wiki/tex_web.rhtml to make them compatible.
You may run into trouble if you try to access your instiki using http://www.yourdomain.com/instiki/public instead of http://www.yourdomain.com/instiki/public/ (mind that slash!)
NOTE – just set the target for your web directory to
/home/username/yourdomain.com/instiki/publicfrom the Dreamhost Hosting Panel – that way you can use something nicer like:
wiki.yourdomain.comto access instiki.