[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Antwort: Re: Antwort: RE: Short question about SSI in dynamic CGI output



CAUTION: This e-mail originated outside the University of Southampton.

Hi John

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 #-)

Kind regards
Jens

--
Jens Witzel
Zentrale Informatik
Universit?t Z?rich
Stampfenbachstrasse 73
CH-8006 Z?rich

mail:  jens.witzel at uzh.ch
phone: +41 44 63 56777
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.zi.uzh.ch%2F&data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2f1ea4280b4844f3694908d9145d6477%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637563213608550763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6uE5feNPwqy9fuhL02B3zh%2FbbB%2F8YnJwgUhNNMRwYic%3D&reserved=0

[Inactive hide details for "John Salter" ---07.05.2021 16:47:54---Hi Jens, I'm glad it helped a bit - even if it wasn't a soluti]"John Salter" ---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

Von: "John Salter" <J.Salter at leeds.ac.uk>
An: "jens.witzel at uzh.ch" <jens.witzel at uzh.ch>
Kopie: "eprints-tech at ecs.soton.ac.uk" <eprints-tech at ecs.soton.ac.uk>
Datum: 07.05.2021 16:47
Betreff: Re: Antwort: RE: [EP-tech] Short question about SSI in dynamic CGI output

________________________________



Hi Jens,
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.
The key is possibly in the PerlOutputFilterHandler.

In a cgi script, something like (entirely untested! Just thinking out loud...):

##############
use Apache2::Filter;
use Apache2::SSI;

my $r = $repo->get_request;

$r->add_output_filter(\&Apache2::SSI::handler);

# do stuff, return page
##############

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'.
Make sure the rewrite trigger does not? set a return code - so the normal handlers will then process the actual request.

Cheers,
John

________________________________

From: jens.witzel at uzh.ch <jens.witzel at uzh.ch>
Sent: 07 May 2021 13:28
To: John Salter <J.Salter at leeds.ac.uk>
Cc: eprints-tech at ecs.soton.ac.uk <eprints-tech at ecs.soton.ac.uk>; jens.witzel at uzh.ch <jens.witzel at uzh.ch>
Subject: Antwort: RE: [EP-tech] Short question about SSI in dynamic CGI output

Dear John

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.

Kind regards
Jens

--
Jens Witzel
Zentrale Informatik
Universit?t Z?rich
Stampfenbachstrasse 73
CH-8006 Z?rich

mail:  jens.witzel at uzh.ch
phone: +41 44 63 56777
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%7C637563213608550763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=6uE5feNPwqy9fuhL02B3zh%2FbbB%2F8YnJwgUhNNMRwYic%3D&amp;reserved=0<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%7C637563213608550763%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=6uE5feNPwqy9fuhL02B3zh%2FbbB%2F8YnJwgUhNNMRwYic%3D&amp;reserved=0>

"John Salter" ---20.04.2021 18:11:15---Hmmm, good question! If you print an SSI instruction directly from the CGI script, does that get con

Von: "John Salter" <J.Salter at leeds.ac.uk>
An: "eprints-tech at ecs.soton.ac.uk" <eprints-tech at ecs.soton.ac.uk>, "jens.witzel at uzh.ch" <jens.witzel at uzh.ch>
Datum: 20.04.2021 18:11
Betreff: RE: [EP-tech] Short question about SSI in dynamic CGI output

________________________________



Hmmm, good question!

If you print an SSI instruction directly from the CGI script, does that get converted as expected? E.g. does
print '<!--#echo var="DATE_LOCAL" -->';
output a date, or '<!--#echo?'?

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.

I find the diagram here: 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%7C637563213608560718%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=peRTH%2BgYvoEcQtQM78EwEa0ajDVkZzT2D5F7qI%2F5IKE%3D&amp;reserved=0 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.

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).

The start of this page: 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%7C637563213608560718%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=o0RVNLC3vSapIhoSVN0Wi%2F6vcnYDHT%2Fk6Wvbr36N8B4%3D&amp;reserved=0 indicates that someone has been down this path before:
"If you want to add dynamic content to the template you should do this via a template part in cfg.d/dynamic_template.pl"

They possibly included a maintenance.ssi file using perl-based methods rather than SSI methods?

Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of jens.witzel--- via Eprints-tech
Sent: 20 April 2021 16:06
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Short question about SSI in dynamic CGI output

CAUTION: This e-mail originated outside the University of Southampton.
Hi out there

maybe stupid. maybe simple, maybe offtopic, maybe not:

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.
Scenario: We generate static code, push it into a simple textfile.ssi and try to include it in the template with  <!--#include virtual="/maintenance.ssi" -->

So, in a nutshell: HowTo tell CGIs/Apache to use SSI after CGI has done? We thought, we tried out everything in Apache conf.
Any hint is appreciated #-)

Kind regards
Jens

--
Jens Witzel
Zentrale Informatik
Universit?t Z?rich
Stampfenbachstrasse 73
CH-8006 Z?rich

mail:  jens.witzel at uzh.ch<mailto:jens.witzel at uzh.ch>
phone: +41 44 63 56777
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%7C637563213608560718%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=beGo2hoOpjq4Ty1hQeR23SlU9m5wj1bMjCU6ABH%2BJhs%3D&amp;reserved=0<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%7C637563213608560718%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=beGo2hoOpjq4Ty1hQeR23SlU9m5wj1bMjCU6ABH%2BJhs%3D&amp;reserved=0> [Anhang "graycol.gif" gel?scht von Jens Witzel/at/UZH]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20210511/d5b3499d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20210511/d5b3499d/attachment-0001.gif