Typo Changes

Posted by sethbc on January 14, 2006

I’ve been trying to file some patches to typo in trac recently, and i’ve been fairly successful at getting the changes to work exactly the way I want!

pdcawley committed my diff for logarithmic sizing in the tag cloud, so that’s out of the way now.

Last night I worked on my sitemap.xml support, and I’m pleased to say it now supports both tag and category pages in addition to pages and articles! Now I just have to see what google says about the new sitemap.

Fighting with Typo

Posted by sethbc on January 04, 2006

I’ve been fighting with Typo all afternoon, hopefully it’s happy now and things will be a little more reliable!

Typo Bugs

Posted by sethbc on December 29, 2005

So I’ve been diving into the source code for Typo, checking out several of the Trac entries, and looking to fix some bugs. My RSS feeds weren’t working quite right, so I had to change the routes.rb entry for xml/rss. I needed to tack :format => ‘rss20′ on the end there, then everything worked fine. There are some rumblings that there’s trouble constructing the ping to Technorati, and I’m going to take a look at that too.

New Blog…

Posted by sethbc on December 26, 2005

Well for about the 4th time in the last year, I’ve migrated my blog again. This time though, i’ve migrated it back to my server, using typo as the platform. This should hold for a while :-)

Ubuntu, Rails, Typo and Apache2 3

Posted by sethbc on December 25, 2005

I know dapper is in pre-release right now, but I decided to go ahead and get flight2 up and running, and document my experience installing Typo from scratch.

This install basically requires 2 steps, only one of which I’m going to document. The first step, is installing Ubuntu Dapper Flight 2, and this is up to you. These instructions will almost certainly work with Breezy, and possibly some of the older versions of Ubuntu. As far as Debian is concerned, I have no idea whether or not this will work, so YMMV.

Ubuntu Repository Data

First and foremost, in order to have a working Rails install, we’re going to need to enable the universe repository.

Open /etc/apt/sources.list, and make sure to uncomment the lines for the universe repository.

Ruby

As rails is written in Ruby, you need to install a working ruby environment with all the bells and whistles!

sudo apt-get install ruby irb irb1.8  libdbm-ruby1.8 libfcgi-ruby1.8 libfcgi0 libgdbm-ruby1.8 libopenssl-ruby1.8 libruby1.8-dbg ri ri1.8 ruby1.8-dev
	

RubyGems

Because ubuntu doesn’t include rubygems in their repository, you have to install rubygems from source. Fortunately, this isn’t a very complicated installation method, and rubygems has a mechanism to insure it stays up to date outside of APT.

wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
tar zxvf rubygems-0.8.11.tgz
cd rubygems-0.8.11
sudo ruby1.8 setup.rb
	

As of this writing, Rubygems-0.8.11 was the most current version of rubygems, but you might want to make sure that rubygems is up to date with this command: sudo gem install rubygems-update

Installing Mysql

Typo doesn’t require MySQL, but that’s the database that I use to host my blog. To install MySQL, we simply:

sudo apt-get install mysql-common libmysqlclient12 libmysqlclient12-dev mysql-server libmysql-ruby1.8
	

I know that libmysql-ruby1.8 installs the mysql ruby bindings, but in order to make sure I have the most updated bindings, I run:

sudo gem install mysql -y
	

Installing Rails

sudo gem install rails -y
	

Installing Apache2 with fastcgi bindings

sudo apt-get install apache2 libapache2-mod-fcgid
sudo a2enmod fcgid
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
	

Build Essential

Technically, the build-essential packages aren’t necessary, as there are fcgi libraries in Ubuntu, but I always install them anyway. You never know when you’re going to need this stuff

sudo apt-get install build-essential
	

At this point, rails should be installed and functioning.

FastCGI

There are two ways to go about installing FastCGI support, one through APT, the other directly from source.

apt-get install libfcgi-dev
sudo gem install fcgi

Other Modules

There are a number of useful gems that one can install, and installation is a snap with Rubygems.

Say for example you want to install the flickr interface. You’d simply type

sudo gem install flickr -y

and the gem is automagically installed.

Installing Typo

I’m installing typo from the SVN repository, as I find that the code isn’t too ‘bleeding edge,’ and staying current generally has more benefits than drawbacks. In order to check out the code, I went to the

/var/www/

directory, and typed

svn checkout svn://leetsoft.com/typo/trunk typo

Typo is now installed on the machine, but we first have to create the database, add the typo host, and then make some changes in order to ensure that the proper page is displayed.

Creating the typo database is a fairly simple procedure. Use mysqladmin to create the databases like this:

mysqladmin -u root -p create typo_dev
mysqladmin -u root -p create typo_tests
	

Optionally, you can create a separate database for production usage as well. Then import the database schema like so:

cd /var/www/typo/db
mysql -u root -p typo_dev < schema.mysql-v3.sql

Finally you need to edit the

config/database.yml

file. Mine is set up as follows:

login: &login
  adapter: mysql
  host: localhost
  username: root
  password: ROOT_PASSWORD

development:
  database: typo_dev
  <<: *login

test:
  database: typo_tests
  <<: *login

production:
  database: typo_dev
  <<: *login
	

I created my own vhost for typo. I created a file called

typo

in

/etc/apache2/sites-available

. For the contents of the file i included the following:

NameVirtualHost *
<VirtualHost *>
    ServerName sethbc.org
    DocumentRoot /var/www/typo/public/
    ErrorLog /var/log/apache2/error.log
    LogLevel warn

    CustomLog /var/log/apache2/typo.log combined

   <Directory /var/www/typo/public/>
      Options ExecCGI FollowSymLinks
      AddHandler cgi-script .cgi
      AllowOverride all
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

After creating the vhost, make sure to restart apache with

sudo /etc/init.d/apache2 restart

.

The next step in the installation is modifying typo to work properly with the default Ubuntu fcgid handler. In order to do this, open the

.htaccess

file in the public directory of your typo installation, and change

AddHandler fastcgi-script .fcgi

to

AddHandler fcgid-script .fcgi

What else can you do?

I’m planning on writing another one of these, with the aim of getting lighttpd running on ubuntu. As of right now, there is a request for inclusion of lighttpd in Ubuntu, and I’m under the impression that it is now approved for debian, so that should speed the process up somewhat.

Resources

Ruby, Rails, Apache 2 and Ubuntu Breezy (5.10) — http://fo64.com/articles/2005/10/20/rails-on-breezy

RailsOnUbuntuDebianTestingAndUnstable — http://wiki.rubyonrails.com/rails/pages/RailsOnUbuntuDebianTestingAndUnstable

How to install Ruby on Rails on Ubuntu 5.10 — http://claudio.cicali.org/article/74/how-to-install-ruby-on-rails-on-ubuntu-510

Ruby on Rails

Posted by sethbc on November 24, 2005

I’ve been playing with Ruby on Rails a lot recently, and have managed to set up a couple of test sites on my laptop. I’ve got to say, it’s definitely a pretty solid web framework, and it certainly makes development (both standard and AJAX) fairly easy.

One of the coolest rails apps I’ve been playing with is Typo. Now over the last 8 years I’ve used numerous different blog systems/CMS. I think I started out with nuke/postnuke, bounced around between drupal/wordpress and about a million others, so I see no reason why I shouldn’t try out typo:-). I think the interface in typo is just ‘better’ than the interface to wordpress. While drupal is an amazing system, it just has too much power under the hood for merely hosting a blog (and it isn’t tailored enough to blogging).

The other rails app I’ve been playing with is Instiki. Instiki is yet another wiki software, and while it does appear to be both quick and easy to use, I don’t think they can hold a candle to mediawiki.

Rails has been maturing extremely rapidly, and these web apps are extremely young. In the next couple months, things are going to get very interesting. Rails seems to make the design and implementation of a Web 2.0 site pretty easy, and I don’t see rails slowing down any time soon.