Sword 1.0b5 · A simple and friendly weblogging tool for academic environments created by Fingertips design & development.

 
 
 
 
 

Prototype adjustment

TrackBack link: http://blog.markjuh.net/markjuh/trackback/2005/5/30/prototype_adjustment

Published on 30 May 2005 at 12:56, updated on 25 July 2005 at 16:15.

In category Prototype.

The little error I just fixed made me look at some minor issues with running this prototype.

I used Keeping your lighttpd up on TextDrive, part II to make sure lighttpd would be restarted if the Rails FastCGI process had died.

And I also added Pagination to the main weblog part so the page that needs to be loaded is smaller than before (only 5 posts instead of all of them).

Annoying bug

TrackBack link: http://blog.markjuh.net/markjuh/trackback/2005/5/30/annoying_bug

Published on 30 May 2005 at 11:38.

Since Textdrive moved bidwell to new hardware, this application doesn’t seem to function as well as before.

As a first step I’ve removed the contents of the vendor directory and restarted lighttpd, so the gem versions of the Rails components will be used.

Now to figure out why posting fails.

Update: I guess that was it, it’s fully functional again.

Routing

TrackBack link: http://blog.markjuh.net/markjuh/trackback/2005/5/13/routing

Published on 13 May 2005 at 08:34.

I’ve been diving into routing the last two weeks. It’s a great concept, but the code is hard to get through.

One thing that had me puzzled for several hours was that I wasn’t able to break the routing tests, no matter what I did. It turned out there was an error in the filename of the file that contains the routing tests.

After fixing this simple problem, I added support for domains and subdomains to vendor/rails/actionpack/lib/action_controller/routing.rb. The Route::items= method now sets an optional part in array that contains the routing information.

[[domain_info], path_info], where if domain_info is empty, it reduces to [path_info], which is just the regular case it used to be without any domain/subdomain additions.

This makes sure that I did not break existing behaviour, yet provides a way to identify the new items.

Unfortunately, also changes to the test-functions are needed, since currently verify_recognize and verify_generate do not accept / as a prefix for the path. And the possibility to use this prefix is essential in our extension of routing, since we would like to use the following scheme in our application:

//:weblog.ourdomain.org/:year/:month/:day/:post

(the nice Route::items= method would give us [[:weblog, "ourdomain", "org"], :year, :month, :day, :post] here)

Furthermore, the flow of information through the UrlRewrite::rewrite method would need to change. The following implementation would not work anymore:

rewrite_url(rewrite_path(options), options)

But instead rewrite_path should also update the options in a smart way.

Since this is too much of a hassle at the moment, we decided to drop this for a bit and go ahead with the implementation of the pilot version and use URIs of the form /:weblog/:year/:month/:day/:post/.

Daedalus

TrackBack link: http://blog.markjuh.net/markjuh/trackback/2005/5/2/daedalus

Published on 2 May 2005 at 12:50.

I waited for the transfer of bidwell (one of the shared hosting servers of TextDrive) to the new hardware and took some time today to figure out how to get Daedalus to work, so it would monitor lighttpd and restart it if it would crash.

$ mkdir ~/src
$ cd ~/src
$ wget http://svn.textdrive.com/repos/scripts/daedalus-1.2.tar.bz2
$ tar xjvf daedalus-1.2.tar.bz2
$ mkdir ~/daedalus
$ cd ~/daedalus
$ cp ~/src/daedalus/daedalus.rb .
$ mkdir log run
$ wget http://blog.fngtps.textdriven.com/daedalus.conf
$ ./daedalus.rb

And it was up and running.
Just to be sure, I added a cron job to make sure Daedalus gets started each time the server is rebooted.

Of course I cheated and prepared the config file (daedalus.conf) in advance:

name: lighttpd
checkcommand: /bin/ps ax
checkregex: /lighttpd/
onfailcommand: /usr/local/sbin/lighttpd -f /home/thijs/lighttpd/lighttpd.conf
checkinterval: 30
aftercommandwait: 15