Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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
<alexander.farber@xxxxxxxxx> 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.


Back to the top