I must give a preprocessor to HTML pages. Essentially, I've got a program that can take the title of the HTML file that contains preprocessor instructions and results the items in the file after preprocessing to stdout. This mechanism could change whether it makes things simpler. All I wish to do is hook this into Apache to ensure that all of the files that this site serves get subjected to the preprocessor before heading out towards the browser. An answer that actually works along with other HTTP servers than Apache could be preferred, however is not needed.

If my understanding is correct, this really is roughly what PHP does.

Whether it makes any difference, the preprocessor is designed in Python.

For those who have Apache along with a "preprocessor" designed in python, why don't you choose mod_python?