Third post for the day! So what else am I going to do with my time when I'm sick?
Apache 2 is installed and running. You can tell that because that's the server used to display this site. The reason for the swap from the 1.3 tree? Well, the filter feature is what I wanted. The 1.3 tree did everything that I need, except that I wanted to parse the output of a cgi script using something like, say, mod_include. Without this, when cgi scripts output the standard templates for the site, all the SSI content in those templates doesn't get processed. That means that you'll end up with broken bits in the template.
One way around this is to write a perl module (to be used in all your cgi scipts) that will read the file and process the SSI's for you. This is obviously a bad idea, because you have to reproduce all the mod_include functionality yourself, without the benefit of Apache's built in security checking, alias expansion, etc... Not a good option.
Or, you could have the templates actually *be* a cgi script that generates the output (maybe by way of some modules that can be included or executed from your other cgi scripts). This would work nicely for a low volume site (like mine), but for a high volume site it would be a server killer. Given my experience as a Systems Admin, a non-site killer method is better.
The immediate compromise on the above would be to only generate the content periodically, so that the content doesn't have to be parsed. The immediate problem with that is that you lose true dynamic content in your templates: everything is pre-generated. I don't like that idea either, because I lose flexability on what I can put on my page.
Alternatively, you could wrap the cgi output with other apache generated requests that will handle the SSI. The only real way I could achieve this was to use an alternative .shtml file which then has an "includes virtual" directive for the script being called. You can even do some funky stuff like this in your config:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} \.cgi$
RewriteCond %{REQUEST_FILENAME}\.shtml -f
RewriteRule ^(.*)$ $1.shtml
That will automatically try to detect a url with the same name + .shtml on the end, and use that for the request. Inside that file is the include virtual directive for the original cgi script. This method works for cgi scripts when then get method is being used, but mod_include will reject that when the post method is used.
I toyed with some other things, amongst which was trying to add multiple handlers for filetypes, but nothing really worked just right. What I wanted was definately to be able to pass the output of one handler (or filter) through another. Apache 1.3 doesn't allow stacked filters. If you want to pass something through the two modules, then what you actually have to do was to write a new module which contained the functionality of *both* modules, and use that instead of the two original ones. This isn't hard, because the code is already written, but it would be nice to not have to do it.
Luckily, Apache 2 allows stacked output filters. So with one line in the config:
AddOutputFilter INCLUDES .shtml .cgi .pl
everything works the way I want it. So now when you visit cgi generated pages, you see everything that you're supposed to see.