I recently had to use played with mod_ext_filter for a quick fix.
Note |
---|
Put details why this is easy, can call simple external program, it's an outbound filter. |
...
Code Block | ||
---|---|---|
| ||
tpham@myra:/etc/apache2/mods-enabled$ sudo a2enmod Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgi cgid charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info jk ldap log_forensic mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http rewrite setenvif speling ssl status substitute suexec unique_id userdir usertrack version vhost_alias ... Which module(s) do you want to enable (wildcards ok)? ext_filter Enabling module ext_filter. Run '/etc/init.d/apache2 restart' to activate new configuration! tpham@myra:/etc/apache2/mods-enabled$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting ...done. |
Right from their examples,
Code Block | ||
---|---|---|
| ||
# mod_ext_filter directive to define a filter which
# replaces text in the response
#
ExtFilterDefine fixtext mode=output intype=text/html \
cmd="/bin/sed s/breakitdown.ca/myra.homeip.net/g"
<Location />
# core directive to cause the fixtext filter to
# be run on output
SetOutputFilter fixtext
</Location> |
Warning |
---|
Location does not seem to work here. Trying LocationMatch. Directory does seem to work. And no success with jkmounted content. |
However this has limitations. I stopped here and instead used the Substitute.