NAME

Apache::ProxyStuff - mod_perl header/footer/proxy module

SYNOPSIS

<Location /foo>
 SetHandler      perl-script
 PerlHandler     Apache::ProxyStuff
 PerlSetVar      HeaderFile      http://www.bar.com:81/includes/header.html
 PerlSetVar      FooterFile      http://www.bar.com:81/includes/footer.html
 PerlSetVar      BodyAttributes  "TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0"
 PerlSetVar      ProxyPrefix http://www.foo.com
</Location>

DESCRIPTION

Apache::ProxyStuff is module for adding headers and footers to content proxied from other web servers. Rather than sandwiching the content between the header and footer it "stuffs" the header and footer into their correct places in the content -- header after the <BODY> tag and footer before the </BODY> tag. This allows you to give content living on established servers a common look and feel without making changes to the pages.

ProxyStuff also allows you to add attributes to the <BODY> tag and manipulate links, image refs and form actions as needed.

PARAMETERS

  • HeaderFile

    HeaderFile specifies the URL of an HTML page that will be used as the header for proxied content. It will be added after the first <BODY> tag.

    Example: PerlSetVar HeaderFile http://www.bar.com/includes/header.html

  • FooterFile

    FooterFile specifies the URL of an HTML page that will be used as the footer for proxied content. It will be added before the </BODY> tag.

    Example: PerlSetVar FooterFile http://www.bar.com/includes/footer.html

  • ProxyPrefix

    ProxyPrefix specifies a URL which will be prepended to the URI of the request. The new URL is the location of the content to be proxied. If /proxy/content.html is requested and ProxyPrefix is set to http://www.foo.com, the content will be proxied from http://www.foo.com/proxy/content.html.

    Example: PerlSetVar ProxyPrefix http://www.foo.com

  • BodyAttributes

    BodyAttributes allows you to add or modify attributes in the <BODY> tag in the proxied content. If you specify an attribute that exists in the <BODY> tag of the proxied page, the attribute that was in the page will be overwritten with the one you specified. If your attribute does not exist in the original <BODY> tag it will simply be added to the tag.

    Example: PerlSetVar BodyAttributes 'BGCOLOR="#FFFFFF" VLINK="BLUE"'

  • StripHost

    If StripHost is turned on, ProxyStuff will assume that the hostname of the server providing the content is the first part of the URI. For example, if the URI of the request is /foo/some/content.html and ProxyPrefix is set to http://www.foo.com then /foo will be stripped from the URI and a proxy request will be made to http://www.foo.com/some/content.html.

    (This is useful if your site is divided up into unique sections with their own headers/footers and each section has content proxied from multiple servers -- /foo/hr, /bar/hr and /baz/hr.)

    Example: PerlSetVar StripHost Yes

  • AddHost2AHref

  • AddHost2ImgSrc

  • AddHost2FormAction

    AddHost2AHref, AddHost2ImgSrc and AddHost2FormAction are often used in conjunction with StripHost when your proxied content contains absolute links. ProxyStuff will add the provided text to the beginning of HREFs, SRCs and ACTIONs so these URLs are correctly mapped to ProxyStuff directories.

    For example, you set up <Location /foo> to use ProxyStuff. ProxyPrefix is set to http://www.foo.com, StripHost is turned on and AddHost2AHref, AddHost2ImgSrc and AddHost2FormAction are all set to foo. A user requests /foo/some/content.html. ProxyStuff removes /foo and requests http://www.foo.com/some/content.html. The page returned contains links such as <A HREF="/some/content.html">Link</A>. ProxyStuff will turn the link into <A HREF="/foo/some/content.html">Link</A> so when a user clicks on the link, the request will be handled by Apache::ProxyStuff.

    Example: PerlSetVar AddHost2Href foo

PREREQUISITES

Apache::ProxyStuff requires mod_perl, LWP and HTML::TokeParser.

TODO

  • Switch to the XS version of HTML::TokeParser.

AUTHOR

Jason Bodnar <jason@shakabuku.org>

COPYRIGHT

Copyright (C) 2000, Jason Bodnar, Tivoli Systems

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 334:

You forgot a '=back' before '=head1'

Around line 344:

=over should be: '=over' or '=over positive_number'

Around line 346:

You forgot a '=back' before '=head1'

You forgot a '=back' before '=head1'