I want to provide free hosting, and I need to include ads in every page that apache sends to browser, without any changes in code of pages or scripts.

SSI looks as a good solution, but it works only if it is some directives in pages, but I need to configure banner ads in server configs.

Also I try some special modules like mod_layout, but it works very strange and mess up apache output. mod_pgheader is not situable for my needs too - it removes "body" tags at all.