Thu, 09 Nov 2006

Typo and Rails / MySql problems

Posted by Ben Thu, 09 Nov 2006 08:18:44 GMT

The blog is back up again (also moved to the root of the domain) – and hopefully running quicker now thanks to a quick change of hosting setup (Apache and fcgi to pound proxying to mongrel_cluster).

One quick note to anyone experiencing the following problem with Typo running on Debian Linux:

Lost connection to MySQL server during query

The recommended ‘fix’ is to gem install mysql. Doing that on a Debian machine will result in numerous errors unless you also do the following:

$ apt-get install libmysqlclient10-dev
$ gem install mysql

(Thanks to the owner of this blog for the pointer, found via google).

Thu, 03 Aug 2006

Typo 4 Upgrade

Posted by Ben Thu, 03 Aug 2006 22:13:32 GMT

Finally got round to upgrading to Typo 4 (you may have noticed the theme changed again).

Initially I had a problem with the new Typo gem (installing on a Debian server). This was caused by the sqlite3 gem dependency and was resolved quite simply.

Building native extensions.  This could take a while...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Requires the sqlite3 development headers, which were an apt-get command away.

apt-get install sqlite3 sqlite3-ruby libsqlite3-dev
gem install sqlite3-ruby

Install Typo 4

gem install typo
mysqldump <typo_db_name> -uusername -p > backup.sql
mv /old/blog/location /old/blog_bak
typo install /your/path

Copy over database.yml to new location (and also .htaccess file), then update the database.

rake migrate

Restart the webserver and voila.

Wed, 15 Feb 2006

Typo 'Production' Page Caching Gotcha

Posted by Ben Wed, 15 Feb 2006 23:52:00 GMT

Here is a small gotcha and something to watch out for when you are attempting to get the Typo weblog software up and running.

In Production mode the default Typo cache setup is to write out static .html files for pages, categories and archive views.

This is invaluable when running a live system as Rails is not even invoked allowing Apache to respond to the request very efficiently, but quite annoying if you haven’t yet realised this is happening! It certainly caught me out, even when running through ruby script/server -e development the “old” page was being served since the .html file was still present.

ls -l public/articles/2006/02/11/another-weblog.html 
-rw-r--r--  1 www-data www-data 6901 Feb 16 00:03 public/articles/2006/02/11/another-weblog.html

Behind the scenes Typo will deal with refreshing the cached pages for us, but this refresh will only be triggered when changes are made.

Hope this helps someone.