Installing Typo Blog Engine and mod_rails for Multiple Accounts
Apr.13, 2008 in
technology
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!

April 23rd, 2008 at 1:04 am
From the search queries I’m getting, it seems like most of the folks who are landing on this page really aren’t interested in installing Typo. Look for a cleaned-up post focusing on mod_rails on Debian/Ubuntu in the next couple days. I’ll throw in what I know about Capistrano as well.
May 7th, 2008 at 2:32 am
Mack,
I am personally willing to thank you. Your guide is useful to me. It’s just simply what I need, straight to the point, clear and yet, easy to follow.
I have made it installed on my eeepc 900(2nd generation of) asus mini laptop. The same task I have been trying, struggling for almost one week, I did in less than an hour, with one and only gotcha. I had to restart the laptop, reloading the servers (apache and mysql) won’t work.
I am an Indonesian guy who just bought the laptop directly from the street vendor here in Taiwan, and enjoying it while still doing sightseeing around Taipei.
Now the typo is running on localhost on my mini laptop. I am so glad to see it. Again, thank you for the guidance and can not wait for your next one with capistrano.
Peace,
Moch. Arip
May 23rd, 2008 at 4:37 pm
[...] with Passenger – A slightly deeper guide to using Capistrano to deploy mod_rails applications. Installing Typo (blog engine) and mod_rails for multiple accounts – A walkthrough of creating and installing multiple instances of the Typo blogging engine using [...]
July 25th, 2008 at 10:30 pm
Hi Mack.
Thanks for the tutorial :]
I think I saw a tiny misspelling: “create /config.database.yml” -> “create /config/database.yml”
-Tyler