Reputation: 703
Looking for some direction on how to configure Apache to serve files from a different server. Not sure if that's the correct terminology but bear with me.
The setup is as follows:
Virtualized Red Hat Enterprise - running Apache (Webserver) Virtualized Red Hat Enterprise - running PHP (PHP) (virtualized using vSphere 5.0)
The idea is that Apache handles external requests and forwards them to the PHP server where my PHP application is located. PHP would then "return" the result to Apache, which would serve the page back to the user.
What sort of protocol can accomplish this? Can it be done in Apache? The setup is done for security reasons (compromise at webserver level won't permit access to PHP server and vice versa).
A push in the right direction would be a great help.
Upvotes: 2
Views: 1951
Reputation: 312530
You can do this using Apache's proxy functionality. For example:
<VirtualHost *:80>
ServerName myhostname
<Location />
ProxyPass http://address-of-php-server/
ProxyPassReverse http://address-of-php-server/
</Location>
</VirtualHost>
This will cause Apache to proxy requests that match this VirtualHost definition to your PHP application server and return the results to the client.
This presumes that you have mod_proxy
enabled. You're actually running Apache on the "frontend" server and the "backend" server.
There are a lot of good reasons for a setup like this, but it's going to do more to protect the frontend server from vulnerabilities in your PHP code than it will the opposite.
Upvotes: 5