" /> BP's Weblog: August 2005 Archives

« July 2005 | Main | September 2005 »

August 30, 2005

MT 3.2 with FastCGI under Apache

Well, Brad Choate explained how to do it for LightTPD, but for those of us with boring old LAMP installs, here's a brief howto for getting MT 3.2 working in FastCGI mode:

  • First, make sure you've got FastCGI support in apache. On my Debian machine, that's the libapache-mod-fastcgi package, or libapache2-mod-fastcgi for apache2 (make sure you have non-free in your packages list).
  • Likewise, you'll want CGI::Fast for Perl... get it via CPAN, or, again, the Debian package is libcgi-fast-perl
  • Then, you'll need to add the support for mod-fastcgi to whatever directory you run MT from. I added it explicitly, but it appears that the Debian FastCGI package takes care of this already. Of course, you'll also need Options +ExecCGI for that directory, but, you've already done that, 'cause you've got a working MT install, right? If you want to add it explicitly, use "AddHandler fastcgi-script .fcgi", either in your .htaccess, or in the appropriate slot in your httpd.conf
  • Now, modify Brad's example code a little. In particular, I had to add a line before the section of “use” lines

    use lib "lib";

    (this puts the mt/lib dir into the Perl library path) and a couple of lines that you'll have to edit to match your config: (I put these after the “use” lines, but I doubt that's necessary)

$ENV{"PERL5LIB"} = "/path/to/mt/lib";
$ENV{"MTHOME"} = "/path/to/mt";
CONFIG"} = "/path/to/mt/mt.cfg";

Name all of that mt.fcgi, in the same directory as your mt.cgi is now. I made hardlinks to the other names:

ln mt.fcgi mt-comments.fcgi  
ln mt.fcgi mt-tb.fcgi
ln mt.fcgi mt-search.fcgi
ln mt.fcgi mt-view.fcgi  
ln mt.fcgi mt-atom.fcgi

Then, I just use mt.fcgi instead of mt.cgi in my web requests. Nice!

So far, I haven't quite figured out how to get everything using the .fcgi interface... perhaps it's a problem with the PHP dynamic templates, but, after rebuilding my main page, all of the links that would've used .cgi now point to .fcgi. However, all of my single-entry archive pages still point to .cgi.

Anyway, there ya' go. Having problems? Comment below, maybe I can help.


How to fix all things to use the .fcgi's is explained by Brad in the comments. Also, for those of us with weak LAMP installs, and low-traffic sites, some tuning suggestions: Add something like the following to your Apache configs to lower the default limits (file is /etc/apache/conf.d/fastcgi.conf on Debian)

FastCGIConfig -autoUpdate -idle-timeout 120 -killInterval 3600 -maxClassProcesses 3 -maxProcesses 15

You need to raise the idle timeout unless you have a super-quick machine. I was using the 125 row view for comments and trackbacks to clear out old ones, and it was regularly timing out - taking more than the default 30 seconds to rebuild. This can, probably, lead to bad behavior, if not just on-screen error messages.

Raise the kill interval to reduce the regularity of killing the processes. Why pay the overhead of restarting fastcgi processes on a low-volume site? You'd think you'd be able to specify a kill interval in terms of jobs served, but it's time based for whatever reason.

The last two numbers specify how many copies of a given script are kept around, and the total site-wide. It was silly to have 10 copies of mt.fcgi loaded since I'm the only one who uses the admin interface, but why would I want to have 10 copies of the comment script hanging around, either? The virtual memory impact of running all those MT processes was getting too large.

I'm sure there's some way to use the same trick that Brad outlines for LightTPD to use a single instance to handle all the requests. Probably some combination of SetHandler and some other Apache directives. I'll post an update if I figure it out, or anyone tells me...

Tags: ,

August 29, 2005

Movabletypo, (unfortunately) in transition...

Sorry about the downtime, folks. Hopefully, things will stay up a bit longer this time. Alternatives are being pursued to shore things up.

August 25, 2005

Gmail From: now, finally, configurable...

Gmail has now added the ability to totally change your return address... before, you could change the “Reply-To”, meaning that anyone hitting “reply” on a message you sent via g-mail would go where you directed it. They still left the From: as your gmail account, so friends who copy that kind of thing into their address books would still get your gmail address, rather than the address you masquerade as (perhaps because you run your own domain, as I do.)

So, bottom line, now you can set up Gmail so that any address you can receive e-mail to can be your return address. Just go to “Settings”, “Accounts”, add a new address, follow the confirmation process, then go back into Settings/Accounts and “make default”. You'll also be able to choose which of your identities to use to send a message as from a message compose window.

Since gmail doesn't brand your outgoing messages, you can now effectively use gmail as a mail client. All you need is an account capable of mail forwarding. The only traces of gmail on your sent messages are the headers - originating mail servers and the gmail.com domain keys signature they still stick on. Not bad.


August 19, 2005

TiddlyWiki, reloaded

After my previous, less happy experience trying to get TiddlyWiki to be useful as a lightweight publishing platform, I've finally gotten a system together that's a little less reprehensible to use. In particular, it uses pytw, and, well, I can publish to it live. Plus, I finally managed to badger it to running under mod_python, a system I have no experience in.

So, while TiddlyWiki still have some work to do to be useful, I will probably occasionally link off into its space for reference. Here's hoping I can manage to keep from breaking the install.

Also: Anyone want to help Markdown-ify TiddlyWiki? There's a partial solution waiting around to be brought to bear on the problem...

Oh, right, the link: http://geekdom.net/tiddly/

Tags: , ,

August 16, 2005

Piaggio 2k Day

Well, it finally came. On my way home from work on Friday, I crossed 2000 miles on the Piaggio Typhoon. Here's another paltry attempt at a graph.... apologies for the left and right axis being reversed; Excel is really a mess to work with, if you ask me.

Anyway, with my MPG staying constant, and the cost of gas increasing (now over $3.00/gal for many stations, at least for high-test), I expect to see the $ saved continue to frustrate me for how to present it on the same axis as the other data in the chart. Alas.

This chart includes up to just before the final 8 miles, so it's actually fairly accurate.

Piaggio Typhoon Mileage Graph

Tags: , ,

August 09, 2005

Notes from tonight's Web 2.0 BayCHI talk

Here are my notes (Yes, I'm experimenting with TiddlyWiki... note quite there, but fun to tinker with).

Update: Use this notes link instead.


August 06, 2005

Important! Site move finally progressing.... UPDATED

It's taken a little longer than expected, but the server move is in progress.... I partially torched the destination server. I managed to repair it satisfactorily, so, I now plan to do a downtime Monday morning to switch over the last bits of data and control. What this means is:

Please don't make any active changes to your content after about 6am Monday morning, until I post that things are switched over. Changes made during this time might be lost

In the meantime, if you'd prefer to fix things in a non-last-minute way, please check if you see what you expect/your tools work as you think they should by connecting to your normal address, but :81. Ie, http://movabletypo.net:81/whatever (including playing with the posting tools). Data in the database and on disk for the :81 space will be overwritten with current data on Monday morning, so, if you want to test posting/rebuild/commenting and whatever, feel free, it should just all end up cleaned up in the end.

Some things will still take a while to shake out after the switch has finally been thrown. Statistics and logs won't be taken care of until after everything else, probably not until late next week.

UPDATE: The move is done, the switches have been thrown. If you notice anything is acting weird (and, please check!) let me know. In particular, movabletypo folks: please do a rebuild of your site, and check each type of page to make sure that it is correctly built/displayed.