As you may not see, this blog is powered by "Typo":http://typo.leetsoft.com/, a cool "Ruby on Rails":http://www.rubyonrails.com/ driven blog application. However I missed the functionnality of being able to easily host multiple blog on my server. I could not find much info beside a howto which required virtual hosts and implied editing Typo's internal.

So I write down a script to create blogs easily. It uses symlinks to the real Typo directory and a database per user. It works on Linux using MySQL and Apache. It needs "Ruby":http://www.ruby-lang.org/ and "Termios":http://raa.ruby-lang.org/project/ruby-termios/

To use it,

  • download[1] it
  • create a directory $DIR, put the script in it.
  • Download a Typo "release":http://typo.leetsoft.com/trac/wiki/DownloadStable and extract it in $DIR/typo
  • edit or create $DIR/typo/database.yml[2]. You can use "ERB":http://raa.ruby-lang.org/project/erb/ tags in the file. Available variables are user, the user name,@target, the directory in which user blogs are installed and the instance variable of the Manager class.
  • edit the $DIR/typo/.htaccess[3], same remark apply.
  • create the $DIR/apache.conf.erb[4] file, same remark apply. It will be used as a template to create a config file to include in your apache configuration. An example is attached.

Finally run ./manage foo and it will

  • create the user directory,
  • create a database.yml file,
  • ask you the root password for mysql, create and populate database using the Typo MySQL schemas,
  • create the apache.conf file

Now restart your apache, pray and try. Send me comments if something went wrong. Don't forget you need to have the correct permissions and look at the source for more parameters, Luke.

fn1. "manage":http://www.cosinux.org/blogs/dam/files/manager.rb

fn2. "database.yml":http://www.cosinux.org/blogs/dam/files/database.yml

fn3. "htaccess":http://www.cosinux.org/blogs/dam/files/htaccess.erb

fn4. "apache.conf.erb":http://www.cosinux.org/blogs/dam/files/apache.conf.erb