I decided my to use Typo for my new blog, but I wasn’t satisfied to install it in the usual way because I want multiple blogs. This is also my first hands-on experience with mod_rails, so it’s a nice opportunity to play.

The following instructions work for Ubuntu 7.10 (gutsy gibbon), and I’m assuming some level of familiarity with Ubuntu and/or Debian. Same ideas should apply elsewhere though (YMMV). If I’ve glossed over too much, leave a comment and I’ll try to clarify.

Install these packages using apt-get

  • mysql-server
  • ruby
  • libmysql-ruby
  • rdoc1.8
  • ri1.8
  • apache2-mpm-prefork
  • ruby1.8-dev
  • build-essential
  • apache2-prefork-dev
  • libapr1-dev
  • libopenssl-ruby1.8

Install RubyGems

  • Download the latest RubyGems from RubyForge
  • Unpack and cd into the created directory
  • Install with: ruby setup.rb
  • I created a symbolic link, but it’s not a requirement: cd /usr/bin; ln -s gem1.8 gem
  • Add to your path, or append to ~/.bashrc:
export PATH=$PATH:/usr/lib/ruby/gems/1.8/bin

Install these using gem

  • passenger
  • rcov

Configure Apache

  • passenger-install-apache2-module
  • Create /etc/apache2/mods-available/rails.load
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
  • Create /etc/apache2/mods-available/rails.conf
<IfModule passenger_module>
  RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
  RailsRuby /usr/bin/ruby1.8
</IfModule>
  • a2enmod rails
  • a2enmod rewrite
  • /etc/init.d/apache restart

Get Typo

Download the latest and stash it somewhere, like /var/tmp perhaps.

Per-Blog Setup

  • Create a standard user to own the site.
  • In mysql as root
create database macksmind;
grant all on macksmind.* to macksmind identified by 'dontyouwish';
  • su - username
  • unpack the copy of typo that you stashed
  • create <typodir>/config/database.yml
login: &login
  adapter: mysql
  socket: /var/run/mysqld/mysqld.sock
  username: macksmind
  password: dontyouwish

development:
  database: macksmind_dev
  <<: *login

test:
  database: macksmind_tests
  <<: *login

production:
  database: macksmind
  <<: *login
  • Create /etc/apache2/sites-available/username
<VirtualHost *>
  ServerName macksmind.net
  ServerAlias www.macksmind.net
  DocumentRoot /home/macksmind/typo/public
</VirtualHost>
  • a2ensite username
  • /etc/init.d/apache reload

That should be it. Enjoy!