The end of GeoCities

Friday, April 24, 2009 - 06:41 AM

Apparently, Yahoo is shutting down GeoCities at some point this year. To me, this marks an end, of sorts, to the original dot-com era.

Back in my days at theglobe.com, my primary project was our homepage builder. Eventually had some marketing-oriented name for it (uBuilder?), but not for most of the time I was working on it. It originated as a way for users of our web based chat system to upload personal icons, and ended up as a GeoCities competitor.

The big thing, I felt, that made us "better", were that we didn't have complicated URLs based on which "community" your page was in, we just had "members.theglobe.com/username/" style URLs. Also, I think our page building tools were better and more flexible. On the downside, I think at our peak, we had about 1-5% of the traffic that GeoCities did (although over a million page views in a day was a big deal back in 1997, on 1997 era hardware). On the upside, in 1997, the only developer working on this project was me, so our development team was cheaper.

But for fun, here's Jon's page. We made ones for toothgnip and diablo too, but they don't seem to be archived.

[ read/post comments | 0 of 0 comments ]

Apache deflation and negotiation

Friday, April 17, 2009 - 04:38 PM

Sometimes, wasting time isn't entirely unproductive.

This week, while thinking of getting work done on some longer term projects that are standing nearby and mocking me, I somehow got conned into installing Yahoo's YSlow Firefox extension.

It's pretty cool in a masochistic sort of way. It gives you a performance evaluation of whatever site you're looking at, based on "best practices" for HTML, server configs, etc. In my case, the one thing that popped out at me while looking at my homepage here, was that I wasn't compressing any of the "text" content (HTML, CSS, JavaScript, RSS feeds, etc.) that the machines serve. Server side auto-compression is one of those things that I remember looking at a few years ago before being distracted by the next shiny bauble that prevented me actually doing anything about it.

The idea is to auto-compress any text being served back so that the payload delivered to the clients (you and your web browser) is smaller, gets to you faster, and loads faster. Computers are fast enough, and the files are small enough that the compression speed-hit is far outweighed by the network latency speed-gain.

As an added bonus, since the server has to hold the network connection, with all it's associated memory and resource usage, open until the client is finished getting all its content, this frees up those resources a little bit faster.

The first step was enabling apache's mod_deflate module. This seems simple enough, the docs even have a perfect example right at the top:

Compress only a few types

AddOutputFilterByType DEFLATE text/html text/plain text/xml

Nifty! Now let's check the documentation for AddOutputFilterByType:

Compatibility: Available in Apache 2.0.33 and later; deprecated in Apache 2.1 and later

Well, crap.

I'm running Apache 2.2 (which is also what all the documentation links point to), so I probably shouldn't start by implementing this with a deprecated config directive.

It does point us in the direction of its replacement, the mod_filter module. Reading through all this documentation is not entirely unconfusing, as there are a lot of parts without a very coherent picture of a whole. At the end of the day, what it comes down to is that I need to first define my filter, and then apply it where and how I want to. To define it, I put at the top of my config:
FilterDeclare compress-response
FilterProvider compress-response DEFLATE resp=Content-Type $text/
FilterProvider compress-response DEFLATE resp=Content-Type $application/x-javascript

This declares a filter with the name "compress-response" and then says that it should be applied to anything with a MIME-Type starting with "text/" (i.e. text/html), or "application/x-javascript". Further down, in the virtual hosts that I want to use this compression, I need to add the line:
FilterChain compress-response
Nice and easy!

For the purposes of full disclosure, there's also some stuff in the mod_deflate documentation that I used for determining browsers where this will and won't work, so the full set of directives is:
<Location />
# Insert filter
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

FilterChain compress-response
</Location>

I'll probably eliminate a bunch of those at some point as I don't think we need to worry about Netscape 4 a whole lot these days.

This worked, and made me happy. It's been live for most of this week, and nobody noticed, commented, or complained. Success!

What bugged me about this, is that while compressing on the fly makes sense for all the dynamic pages (most of mine and my clients' sites), it seems like a waste of resources for things like the JavaScripts served back from OhNoRobot, which are written to disk and then served back multiple times. It makes more sense to zip them once, when they're being written, and then serve those back to the clients that can handle it.

I'm about a decade too late to be the first person to think of this, so it's also conveniently built into Apache. Content Negotiation also supports sending back pages in multiple languages, but for my purposes I wanted to send back a ".gz" file instead of a ".js" if there was one available. The two important things to do are: add MultiViews to your enabled Options, and do an AddEncoding for the .gz files:
<Location "/js/">
Options +MultiViews
ForceType "application/x-javascript"
AddEncoding x-gzip .gz
</Location>

I also had to add the ForceType directive, because otherwise the .gz version of the file would be served back with Content-Type: application/x-gzip instead of as JavaScript. The other thing that wasn't immediately clear in the documentation is that in order to support the content negotiation for .gz or .js, you need to have both files there, but both need to be a ".js" file plus the encoding suffix, so (for example) Dinosaur Comics needs to have both "/js/23.js.js" and "/js/23.js.gz" on disk.

If you want to test this using curl from the command line, add "-H "Accept-Encoding: gzip,deflate"" to your requests, e.g.: curl -vI -H "Accept-Encoding: gzip,deflate" http://www.dumbrellahosting.com/

As a final remark, I'm pretty sure that most of the above is pretty obvious to all good Apache administrators. However, for those of us doing that as just one part of a larger job, it seems remarkably difficult to find a coherent set of task-oriented how-tos. Mostly I document this so I'll remember what the hell I was thinking when I look at this config again next year.

[ read/post comments | 0 of 0 comments ]

Webcomics Weekend

Thursday, March 19, 2009 - 09:39 PM

A little late on the uptake, but it is 99% certain that I will be in Easthampton this weekend for the epic New England Webcomics Weekend.

I'm looking forward to being at a gathering and not working! (too much.)

[ read/post comments | 0 of 0 comments ]

mod_perl2 and libapreq2 on Mac OS X Leopard

Wednesday, January 21, 2009 - 12:27 PM

Just to document this somewhere...

I wanted to get mod_perl2 (and the associated libapreq2) running under the web server on my MacBook Pro.

However, when you just install them from CPAN, you get the following error from apache:
Cannot load /usr/libexec/apache2/mod_perl.so into server: dlopen(/usr/libexec/apache2/mod_perl.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_perl.so: no matching architecture in universal wrapper

(Once you fix this, you get a similar error for libapreq2:
Cannot load /usr/libexec/apache2/mod_apreq2.so into server: dlopen(/usr/libexec/apache2/mod_apreq2.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_apreq2.so: mach-o, but wrong architecture
Documented here purely for search engine indexing purposes.)

It turns out that the fix is two-fold.

The root cause is that the Mac now supports multiple different chip architectures, to see this, run the file command on an executable:
$ file /usr/sbin/httpd
/usr/sbin/httpd: Mach-O universal binary with 4 architectures
/usr/sbin/httpd (for architecture ppc7400): Mach-O executable ppc
/usr/sbin/httpd (for architecture ppc64): Mach-O 64-bit executable ppc64
/usr/sbin/httpd (for architecture i386): Mach-O executable i386
/usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable x86_64

or:
$ file /usr/bin/perl
/usr/bin/perl: Mach-O universal binary with 2 architectures
/usr/bin/perl (for architecture ppc7400): Mach-O executable ppc
/usr/bin/perl (for architecture i386): Mach-O executable i386

The problem is in mixing architectures, and that cpan (or gcc, or perl, or the default environment, or something), only compiles for the i386 architecture by default. After some googling, I learned that the solution is that you need to "force" cpan to compile the shared libraries for both the i386 and the x86_64 architectures. To do this you need to run:
$ export ARCHFLAGS="-arch i386 -arch x86_64"
$ export CFLAGS="-arch i386 -arch x86_64"

(or add those lines to ~/.profile and open a new terminal window.)

However, after that libapreq2 still fails, which brings me to why I'm writing this. The only link I found with a solution was: http://my.opera.com/ismailp/blog/2008/09/05/svn-web-on-mac-os-x-leopard:

I simply had to hack libapreq2's Makefile.PL and changed following line:
my $cmd = "./configure $opts";
to:
my $cmd = "./configure $opts --disable-dependency-tracking";

Then, clean up my previous attempts, run the make/install process again, and httpd -t (or apachectl configtest) suddenly work.

Undoubtedly, DBI or something will break next, but at least it's a start.

[ read/post comments | 0 of 0 comments ]

excuses, excuses...

Tuesday, November 25, 2008 - 01:17 PM

Man... I wish I had excuses this good for never updating.

Instead I'm dealing with optimizing memory usage of older code, adding caching where necessary, and trying to get a handle on nagios. Much more boring.

[ read/post comments | 1 of 1 comments ]

Helping out Southworth

Sunday, August 24, 2008 - 05:07 PM

So I'm behind the curve on getting this out there, but as noted by Gary, Paul Southworth (also a fellow RIer) has falle afoul of some nefarious characters. Help simply requires 2 things:

  1. SasqWatch 2813
  2. A Trunk Deadfall Adventure

and my work here is now complete.

[ read/post comments | 0 of 0 comments ]

SDCC: the wrap-up

Wednesday, August 06, 2008 - 03:27 PM

San Diego Comic-Con boothcam

So, it's a week late, but at least it's written. At least the extra week allows me to pretty much just link to everyone else's wrap-up posts, instead of having to write my own.

Here we have reports from:

So for my part... I want to thank Wil and Scott for abusing our booth space. (Wil has a great picture of our booth, too.) Having them there definitely brought over new people who otherwise wouldn't find Dumbrella. It was really cool to have Chris and Frontalot with us this year, too. It added a whole `nother element to the booth (and I think that Andy was just happy to have someone else selling toys too).

Best year ever? Probably. Now to start planning for making next year better.

[ read/post comments | 0 of 0 comments ]

Dumbrella Hosting

Dumbrella Hosting is a provider of premium hosting services for webcomics creators. Learn more!