| ProxyInput ($r, $in, $mtime, $src, $dest) | top |
B<USAGE in srm.conf:>
<Location /embperl/ifunc>
SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI
PerlSetEnv EMBPERL_INPUT_FUNC "ProxyInput, /embperl/ifunc, http://otherhost/otherpath"
</Location> This input function will request the source from another URL instead of
reading it from the disk.
In the above USAGE Example, a request to /embperl/ifunc/foo.html, will first fetch the
URL http://otherhost/otherpath/foo.html, and then it will process this document by Embperl
and then it will send it to the browser. This could be used to process documents by mod_include and Embperl, so in one
document there can be both Server-Side Includes and Embperl Commands. Example B<srm.conf> for B<SSI> and B<Embperl>:
<Location /embperl>
SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI
PerlSetEnv EMBPERL_INPUT_FUNC "ProxyInput, /embperl, http://localhost/src"
</Location> <Location /src>
SetHandler server-parsed
Options +Includes
</Location> The source files must be in the location /src, but they will be requested via the
URI /embperl. Every request to /embperl/foo.html will do a proxy-request to /src/foo.html.
The file /src/foo.html will be processed by mod_include and then sent to Embperl, where it
can be processed by Embperl before being sent to the browser. It would also be possible to use
two httpd's on different ports. In this configuration, the source and the URI location
could be the same.
| LogOutput ($r, $out, $basepath) | top |
B<USAGE in srm.conf:>
<Location /embperl/ofunc>
SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI
PerlSetEnv EMBPERL_OUTPUT_FUNC "LogOutput, /usr/msrc/embperl/test/tmp/log.out"
</Location> LogOutput is a custom output function. It sends the output to the browser and
writes the output to a unique file. The filename has the form
"$basepath.$$.$LogOutputFileno".
|
|