I have a VPS and want to used a forward proxy set-up so that I can appear to be browsing from my VPS IP address rather than my client address. If I set up a proxy directive in httpd.config like this:
<IfModule proxy_module>
<IfModule proxy_http_module>
ProxyRequests On
ProxyVia On
<Proxy *>
Order Deny,Allow
Deny from all
Allow from (**client ip address**)
</Proxy>
</IfModule>
</IfModule>
... I think this will only allow my client ip address to use the proxy BUT will also prevent the rest of the world accessing web pages from my server.
Is there a way of putting all this into a virtualhost or .htaccess directive so that the proxy only 'kicks in' when accessed through a specific URL?
Absolutely, see the "context" lines for various apache proxy directives that can be used in virtual hosts: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html . I don't think you'll be able to use
.htaccess
for this purpose.Update:
Your configs look correct, however, start with this in your
<VirtualHost>
configs:<ifmodule>
tags -- as long you have the necessaryLoadModule
lines somewhere earlier in the confsUpdate: Something like this should set you on the right path. Note, this is untested.