Re: [jetty-users] Configuring Jetty for FastCGI - and pass env. vars to PHP scripts
Hi, On Wed, Apr 1, 2020 at 11:59 AM Alexander Farber wrote: > Thank you - I have created > https://github.com/eclipse/jetty.project/issues/4735 > > Your suggestion for creating a custom FarberFCGIServlet - is it to set > $_SERVER['COUNTRY'] inside the PHP scripts? Correct. The FarberFCGIServlet will read an environment variable from the Jetty process and add it to every request sent to the PHP process. The PHP process can then use $_SERVER[name] to retrieve that value. > And also - how to add the custom FarberFCGIServlet to the Jetty instances, > which are currently being run by the command below? > > ExecStart=/usr/bin/java -Djdbc.drivers=org.postgresql.Driver -jar > /usr/share/java/jetty-distribution-9.4.27.v20200227/start.jar > jetty.home=/usr/share/java/jetty-distribution-9.4.27.v20200227 > jetty.base=/var/www/jetty-base-en jetty.http.host=127.0.0.1 > jetty.http.port=8082 You have to replace the FastCGIProxyServlet you have in your wordsbyfarber.com.xml with FarberFCGIServlet. And you have to put the jar containing FarberFCGIServlet in $JETTY_HOME/lib. Implementing #4375 was trivial and I tested it. Would you be able to test it on your configuration by building Jetty yourself? -- Simone Bordet http://cometd.org http://webtide.com Developer advice, training, services and support from the Jetty & CometD experts. ___ jetty-users mailing list jetty-users@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users
Re: [jetty-users] Configuring Jetty for FastCGI - and pass env. vars to PHP scripts
Hello Simone - On Tue, Mar 31, 2020 at 11:51 PM Simone Bordet wrote: > What you can do right now is to override this: > > class FarberFCGIServlet extends FastCGIProxyServlet { > protected void customizeFastCGIHeaders(Request proxyRequest, > HttpFields fastCGIHeaders) { > super.customizeFastCGIHeaders(proxyRequest, fastCGIHeaders); > fastCGIHeaders.put("COUNTRY", System.getenv("COUNTRY")); > ... > } > } Thank you - I have created https://github.com/eclipse/jetty.project/issues/4735 Your suggestion for creating a custom FarberFCGIServlet - is it to set $_SERVER['COUNTRY'] inside the PHP scripts? Because currently that variable is not there. Or how would I be able to retrieve the fastCGIHeaders from PHP? And also - how to add the custom FarberFCGIServlet to the Jetty instances, which are currently being run by the command below? ExecStart=/usr/bin/java -Djdbc.drivers=org.postgresql.Driver -jar /usr/share/java/jetty-distribution-9.4.27.v20200227/start.jar jetty.home=/usr/share/java/jetty-distribution-9.4.27.v20200227 jetty.base=/var/www/jetty-base-en jetty.http.host=127.0.0.1 jetty.http.port=8082 Best regards Alex ___ jetty-users mailing list jetty-users@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users
Re: [jetty-users] How to include another web page in a page served by Jetty?
On Wed, Apr 1, 2020 at 8:32 AM Greg Wilkins wrote: > If client side is an option, there are always simple iframes as an option > > Right! Thank you for the advice ___ jetty-users mailing list jetty-users@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users
Re: [jetty-users] How to include another web page in a page served by Jetty?
On Tue, 31 Mar 2020 at 21:16, Alexander Farber wrote: > Thank you for your response Greg - > > > On Mon, Mar 30, 2020 at 10:09 AM Greg Wilkins wrote: > >> >> Jetty supports the Servlet API feature of RequestDispatcher.include, so >> one URI/resource can be included in another page. The trick is how do you >> trigger than in the content that you are generating?From the servlet, >> it should be easy enough to get a RequestDispatcher and call it directly. >> If you want to do this from static content, then you will need to use >> something like JSP to process that content and allow dynamic components to >> be added. For wordpress... either do it in wordpress... or do something >> very complex about intercepting responses and rewriting with the new >> content - possible but a lot of work. >> > > then I will better use jQuery in my test server pages to fetch and insert > the web page content > If client side is an option, there are always simple iframes as an option > Regards > Alex > > > ___ > jetty-users mailing list > jetty-users@eclipse.org > To unsubscribe from this list, visit > https://www.eclipse.org/mailman/listinfo/jetty-users > -- Greg Wilkins CTO http://webtide.com ___ jetty-users mailing list jetty-users@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users