views:

476

answers:

2

I have the following setup:

  • Plain-Server: Delivering php-files as plain text
  • Proxy-Server: Asking the Plain-Server for the php file and parsing it.

Now my question: How do I configure the Proxy-Server (a fully configurable apache 2.2 with PHP 5.3) to interpret the plain php files from Plain-Server?

Example: Given a small php script "hello.php" on Plain-Server (accessible throw http://plainserver/hello.php):

<?php
echo "Hello World";
?>

Plain-Server only outputs it as plain text, no parsing of php-code.

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

The Reverse Proxy is already running, but the execution of php code not working. I tried mod_filter, but couldn't is work. Any ideas how to that?

+1  A: 

You may consider instead sharing the php files from your source server via an nfs mount or something similar to your target server. Tricking the proxy server into doing what you ask seems like the long way around the barn?

jskaggz
+1  A: 

I totally agree with jskaggz, you could build some awfull tricks building some apps that fetch the remote page , dowload it into a local file and then redirect the user to that page that could be executed... but there is a milion security issues and things that might go wrong with that... Can't you just convert the 'plain server' to a php excuting server and do some traditional reverse proxying on your 'proxy server' maybe using mod_proxy: http://www.apachetutor.org/admin/reverseproxies ?

golemwashere