Apache: reverse proxy for handling PHP from another server

I have the following setup:

  • Plain-Server : php file delivery in plain text
  • Proxy server : Plain-Server request for php file and its analysis.

Now my question is: how to configure Proxy-Server (fully custom apache 2.2 with PHP 5.3) to interpret simple php files with Plain-Server?

Example: for a small php script "hello.php" on a Plain-Server (available cast http: //plainserver/hello.php ):

<?php echo "Hello World"; ?> 

Plain-Server displays it only as plain text, without parsing php code.

The file "hello.php" does not exist on the proxy server. But when requesting hello.php with Proxy-Server, it should get hello.php from Plain-Server with mod_proxy (Reverse Proxy). It should also parse and execute php, saying only "Hello World".

The reverse proxy is already running, but php code execution does not work. I tried mod_filter but could not work. Any ideas like this?

+4
source share
3 answers

Instead, you can share php files from the source server through mounting nfs or something similar to your target server. To spoof a proxy server to do what you ask seems like a long way around a barn?

+1
source

I totally agree with jskaggz, you could create some terrible tricks that create some applications that retrieve a remote page, dowload it to a local file, and then redirect the user to that page that can be executed ... but there are milion security issues and things that can go wrong with this ... Can you just convert a “simple server” to a php server that issues a request and do traditional reverse proxying on your “proxy server” perhaps using mod_proxy: http: //www.apachetutor.org/admin/reverseproxies ?

+1
source

Responded to the ServerFault version of this thread: https://serverfault.com/a/399671/48061

0
source

All Articles