<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="padding-bottom: 10px; padding-top: 5px;">
<div style="padding:12px; border:1px solid #8D3970; background-color:#F7F9FA; color:#8D3970; font-size:14px; line-height:22px; font-family: Calibri, Arial, Helvetica, sans-serif;">
<strong>CAUTION:</strong> This e-mail originated outside the University of Southampton.
</div>
</div>
<div>
<p><font size="2" face="sans-serif">Hi John</font><br>
<br>
<font size="2" face="sans-serif">thanks again - that seems to be the way. I'll try this at Login.pm ... curently got problems bringing cpan Apache:SSI and RPMs together #-)<br>
<br>
Kind regards<br>
Jens<br>
</font><br>
<font size="2" face="sans-serif">-- <br>
Jens Witzel<br>
Zentrale Informatik<br>
Universität Zürich<br>
Stampfenbachstrasse 73<br>
CH-8006 Zürich<br>
<br>
mail: &nbsp;jens.witzel@uzh.ch<br>
phone: +41 44 63 56777<br>
<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.zi.uzh.ch%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2f1ea4280b4844f3694908d9145d6477%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637563213608580631%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=1oFIGFQc4ahfZNhoAER3dli6QAKYGu0k6v63tN9YAi4%3D&amp;reserved=0" originalSrc="http://www.zi.uzh.ch/" shash="yx1mTNO40AFDtmwYl4Lg6TSmR0e1t2Af0/Z79LU4wrx/wUJ6Y7gLMlHwXzAO+2SQCeN1Q4qJKK9BgYjYxiObBpx4Yr9OTPXyXyNHyQ+lZiErP2U+NDJ4frozMceeWcNhNlzEVPbA1FodsrXs4E0Y5NRHLUPhYw2rYtRYPUx8Hb0=">http://www.zi.uzh.ch</a></font><br>
<br>
<img width="16" height="16" src="cid:1__=4EBB0C41DFA1E9538f9e8a93df938690918c4EBB0C41DFA1E953@lotus.uzh.ch" border="0" alt="Inactive hide details for &quot;John Salter&quot; ---07.05.2021 16:47:54---Hi Jens, I'm glad it helped a bit - even if it wasn't a soluti"><font size="2" color="#424282" face="sans-serif">&quot;John
 Salter&quot; ---07.05.2021 16:47:54---Hi Jens, I'm glad it helped a bit - even if it wasn't a solution. A few more musings below. I think</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">Von: </font><font size="1" face="sans-serif">&quot;John Salter&quot; &lt;J.Salter@leeds.ac.uk&gt;</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">An: </font><font size="1" face="sans-serif">&quot;jens.witzel@uzh.ch&quot; &lt;jens.witzel@uzh.ch&gt;</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Kopie: </font><font size="1" face="sans-serif">&quot;eprints-tech@ecs.soton.ac.uk&quot; &lt;eprints-tech@ecs.soton.ac.uk&gt;</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Datum: </font><font size="1" face="sans-serif">07.05.2021 16:47</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Betreff: </font><font size="1" face="sans-serif">Re: Antwort: RE: [EP-tech] Short question about SSI in dynamic CGI output</font><br>
</p>
<hr width="100%" size="2" align="left" noshade="" style="color:#8091A5; ">
<br>
<br>
<br>
<font size="3" face="Calibri">Hi Jens,<br>
I'm glad it helped a bit - even if it wasn't a solution. A few more musings below. I think there must be a way to make it work.</font><br>
<font size="3" face="Calibri">The key is possibly in the PerlOutputFilterHandler.
</font><br>
<br>
<font size="3" face="Calibri">In a cgi script, something like (entirely untested! Just thinking out loud...):</font><br>
<br>
<font size="3" face="Calibri">##############</font><br>
<font size="3" face="Calibri">use Apache2::Filter; </font><br>
<font size="3" face="Calibri">use Apache2::SSI;</font><br>
<br>
<font size="3" face="Calibri">my $r = $repo-&gt;get_request;</font><br>
<br>
<font size="3" face="Calibri">$r-&gt;add_output_filter(\&amp;Apache2::SSI::handler);</font><br>
<br>
<font size="3" face="Calibri"># do stuff, return page</font><br>
<font size="3" face="Calibri">##############</font><br>
<br>
<font size="3" face="Calibri">If you get it working, and you wanted it to apply to all cgi requests, you could put something similar in a URL rewrite trigger that matches 'cgi'.</font><br>
<font size="3" face="Calibri">Make sure the rewrite trigger </font><font size="3" face="Calibri"><b>does not</b></font><font size="3" face="Calibri">​ set a return code - so the normal handlers will then process the actual request.</font><br>
<br>
<font size="3" face="Calibri">Cheers,</font><br>
<font size="3" face="Calibri">John</font><br>
<br>
<hr width="100%" size="2" align="left">
<br>
<font size="2" face="Calibri"><b>From:</b></font><font size="2" face="Calibri">&nbsp;jens.witzel@uzh.ch &lt;jens.witzel@uzh.ch&gt;</font><font size="2" face="Calibri"><b><br>
Sent:</b></font><font size="2" face="Calibri">&nbsp;07 May 2021 13:28</font><font size="2" face="Calibri"><b><br>
To:</b></font><font size="2" face="Calibri">&nbsp;John Salter &lt;J.Salter@leeds.ac.uk&gt;</font><font size="2" face="Calibri"><b><br>
Cc:</b></font><font size="2" face="Calibri">&nbsp;eprints-tech@ecs.soton.ac.uk &lt;eprints-tech@ecs.soton.ac.uk&gt;; jens.witzel@uzh.ch &lt;jens.witzel@uzh.ch&gt;</font><font size="2" face="Calibri"><b><br>
Subject:</b></font><font size="2" face="Calibri">&nbsp;Antwort: RE: [EP-tech] Short question about SSI in dynamic CGI output</font><font size="3" face="serif">&nbsp;</font><br>
<font size="3" face="serif">&nbsp;</font><br>
<font size="2" face="sans-serif">Dear John</font><font size="3" face="serif"><br>
</font><font size="2" face="sans-serif"><br>
thank you for your thoughts on the topic. You're right: after testing a lot it really looks like the request for a CGI script does not trigger the SSI handler. We've got to go the perl-based way rather than SSI.<br>
<br>
Kind regards<br>
Jens</font><font size="3" face="serif"><br>
</font><font size="2" face="sans-serif"><br>
-- <br>
Jens Witzel<br>
Zentrale Informatik<br>
Universität Zürich<br>
Stampfenbachstrasse 73<br>
CH-8006 Zürich<br>
<br>
mail: &nbsp;jens.witzel@uzh.ch<br>
phone: +41 44 63 56777</font><font size="2" color="#0000FF" face="sans-serif"><u><br>
</u></font><a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.zi.uzh.ch%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2f1ea4280b4844f3694908d9145d6477%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637563213608590594%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=SA8s%2FtlmZFmlwlZc8jf1yWI4I33hubJ2nuXel58eggs%3D&amp;reserved=0" originalSrc="http://www.zi.uzh.ch/" shash="WOS478I5RD4/0Q4lc12WROxV1hv8piUm9R87POdxuw+0X8YiGFnnM4ydfeFs99UBY2E6yEqE1UkfgnziUiur+NHKU2Lu4SivOQwzbQN6R+rvjsDD5Vv8WOfBxFCG1hAPK5HjazGJbJZ/G5Egrv3/lldHLPBmhyWJIIHH4jXFB0M="><font size="2" color="#0000FF" face="sans-serif"><u>http://www.zi.uzh.ch</u></font></a><font size="3" face="serif"><br>
<br>
</font><font size="2" color="#424282" face="sans-serif">&quot;John Salter&quot; ---20.04.2021 18:11:15---Hmmm, good question! If you print an SSI instruction directly from the CGI script, does that get con</font><font size="3" face="serif"><br>
</font><font size="1" color="#5F5F5F" face="sans-serif"><br>
Von: </font><font size="1" face="sans-serif">&quot;John Salter&quot; &lt;J.Salter@leeds.ac.uk&gt;</font><font size="1" color="#5F5F5F" face="sans-serif"><br>
An: </font><font size="1" face="sans-serif">&quot;eprints-tech@ecs.soton.ac.uk&quot; &lt;eprints-tech@ecs.soton.ac.uk&gt;, &quot;jens.witzel@uzh.ch&quot; &lt;jens.witzel@uzh.ch&gt;</font><font size="1" color="#5F5F5F" face="sans-serif"><br>
Datum: </font><font size="1" face="sans-serif">20.04.2021 18:11</font><font size="1" color="#5F5F5F" face="sans-serif"><br>
Betreff: </font><font size="1" face="sans-serif">RE: [EP-tech] Short question about SSI in dynamic CGI output</font>
<p></p>
<hr width="100%" size="2" align="left" noshade="">
<font size="3" face="serif"><br>
<br>
</font><font size="2" color="#1F497D" face="Calibri"><br>
Hmmm, good question!</font><font size="3" face="serif"><br>
</font><font size="2" color="#1F497D" face="Calibri"><br>
If you print an SSI instruction directly from the CGI script, does that get converted as expected? E.g. does</font><font size="3" face="Courier New"><br>
print '&lt;!--#echo var=&quot;DATE_LOCAL&quot; --&gt;';</font><font size="2" color="#1F497D" face="Calibri"><br>
output a date, or '&lt;!--#echo…'?<br>
<br>
I haven't used SSIs alongside EPrints, but if the above doesn't interpret the SSI instruction my guess would be the PerlResponseHandler used for CGI scripts within EPrints::Apache::Rewrite module.<br>
<br>
I find the diagram here: </font><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl.apache.org%2Fdocs%2F2.0%2Fuser%2Fhandlers%2Fhttp.html%23HTTP_Request_Cycle_Phases&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2f1ea4280b4844f3694908d9145d6477%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637563213608590594%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=W1hdyxmIJt3X8RCXBg0D0GKIKte1ZiWpEywMDG1YLJI%3D&amp;reserved=0" originalSrc="https://perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Request_Cycle_Phases" shash="yLvOPEUXS6Y+fhwFguXDqEDGhX3zauvvWYJls2U8IxPGLvsAJfYOmS+H34PYE7QjBmfzRLB+lzPB9o+ZeH7rIWdx5IiiWcN/iI7YzgWgJzZR1anY9VNbKXhAeRY4U+Di3secxAKtQnPVCPlUArn+z9xCQNf7YSD2wOV212y2jeg="><font size="2" color="#0000FF" face="Calibri"><u>https://perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Request_Cycle_Phases</u></font></a><font size="2" color="#1F497D" face="Calibri">&nbsp;useful
 to try and work out what the difference might be between e.g. a static page+template being served compared to a cgi script.<br>
<br>
The request for a CGI script might not trigger the SSI handler - but you may be able to add it to the stack, or a different phase (or even the output handlers).<br>
<br>
The start of this page: </font><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FHow_to_enable_server_side_includes&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2f1ea4280b4844f3694908d9145d6477%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637563213608600550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MYYXw%2FTwAHQow8Biq2EDOuR3BFaqR7Iuf1XBKNYTeN4%3D&amp;reserved=0" originalSrc="https://wiki.eprints.org/w/How_to_enable_server_side_includes" shash="TcvceZ9UfNfC/opK/m+OBJci0kagKCE28+GsjI3onBiXHlsIca3kfC37kvFKAzyBsFdeqtInu6FFM3x4++Ch65IFE+rN43caNPP+9Q9pf6QJOlXRAURMWJjvhjC1RTLFzpVRDK6PoRcTWF6ftrxEd2qz0XMBobGh/rC9UMvjIlE="><font size="2" color="#0000FF" face="Calibri"><u>https://wiki.eprints.org/w/How_to_enable_server_side_includes</u></font></a><font size="2" color="#1F497D" face="Calibri">&nbsp;indicates
 that someone has been down this path before:<br>
&quot;If you want to add dynamic content to the template you should do this via a template part in cfg.d/dynamic_template.pl&quot;</font><font size="3" face="serif"><br>
</font><font size="2" color="#1F497D" face="Calibri"><br>
They possibly included a maintenance.ssi file using perl-based methods rather than SSI methods?<br>
<br>
Cheers,<br>
John<br>
</font><font size="2" face="Calibri"><b><br>
From:</b></font><font size="2" face="Calibri">&nbsp;eprints-tech-bounces@ecs.soton.ac.uk [</font><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"><font size="2" color="#0000FF" face="Calibri"><u>mailto:eprints-tech-bounces@ecs.soton.ac.uk</u></font></a><font size="2" face="Calibri">]
</font><font size="2" face="Calibri"><b>On Behalf Of </b></font><font size="2" face="Calibri">jens.witzel--- via Eprints-tech</font><font size="2" face="Calibri"><b><br>
Sent:</b></font><font size="2" face="Calibri">&nbsp;20 April 2021 16:06</font><font size="2" face="Calibri"><b><br>
To:</b></font><font size="2" face="Calibri">&nbsp;eprints-tech@ecs.soton.ac.uk</font><font size="2" face="Calibri"><b><br>
Subject:</b></font><font size="2" face="Calibri">&nbsp;[EP-tech] Short question about SSI in dynamic CGI output</font><font size="3" face="Times New Roman"><br>
</font><font size="2" color="#8D3970" face="Calibri"><b><br>
CAUTION:</b></font><font size="2" color="#8D3970" face="Calibri">&nbsp;This e-mail originated outside the University of Southampton.
</font><br>
<font size="2" face="Arial">Hi out there<br>
<br>
maybe stupid. maybe simple, maybe offtopic, maybe not: <br>
<br>
We found out, that Server Side Includes (SSI) inside phrase dynamic.xml or templates will not be interpreted by cgi-scripts like cgi/stats/report.
<br>
Scenario: We generate static code, push it into a simple textfile.ssi and try to include it in the template with
</font><font size="3" face="Courier New">&nbsp;&lt;!--#include virtual=&quot;/maintenance.ssi&quot; --&gt;</font><font size="2" face="Arial"><br>
<br>
So, in a nutshell: HowTo tell CGIs/Apache to use SSI after CGI has done? We thought, we tried out everything in Apache conf.<br>
Any hint is appreciated #-)<br>
<br>
Kind regards<br>
Jens<br>
<br>
-- <br>
Jens Witzel<br>
Zentrale Informatik<br>
Universität Zürich<br>
Stampfenbachstrasse 73<br>
CH-8006 Zürich<br>
<br>
mail: &nbsp;</font><a href="mailto:jens.witzel@uzh.ch"><font size="2" color="#0000FF" face="Arial"><u>jens.witzel@uzh.ch</u></font></a><font size="2" face="Arial"><br>
phone: +41 44 63 56777</font><font size="3" color="#0000FF" face="serif"><u><br>
</u></font><a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.zi.uzh.ch%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2f1ea4280b4844f3694908d9145d6477%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637563213608600550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Qi9crwNv%2FCSL0y70ff4JZALkHBRZHhndj4tK5xliNsE%3D&amp;reserved=0" originalSrc="http://www.zi.uzh.ch/" shash="ffdUP9udud8SSU3Vrn17O0tdq6nPBzBP5w3JWQ2Gx55X8wE5ZMc3XBw9T6edLNuEHZV/mdm0whW/dhzmIkp3dP2Sf2O/1cKcGrvk7e4kXBj6ZIXESuegRKNjVb70YQLsqOhiboctmte/N0gpoJp6nyun3NWP93VxrQHM/fRhj90="><font size="2" color="#0000FF" face="Arial"><u>http://www.zi.uzh.ch</u></font></a><font size="3" face="serif">&nbsp;[Anhang
 &quot;graycol.gif&quot; gelöscht von Jens Witzel/at/UZH] </font><br>
<br>
</div>
</body>
</html>