I am searching to operate Apache like a proxy for web design. I am running Mac OS X 10.5.4, which already has Apache 2.2.8 installed and running.

Let me point my JavaScript files (that are running in your area on my small machine) to:

http://localhost/test.php

which may hit the neighborhood apache server, then obtain that apache instance toward my real remote server:

http://www.mysite.com/test.php

I have checked out a couple of walkthroughs however they appear to become outdated. I am wondering if there is a recent how-to on setting this up - the doc here:

http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

provides a fundamental example, but I am unsure where that text ought to be added - to http.conf? Will I simply add it there, then restart the server?

Thanks

The proxy setup that you simply describe is known as a Reverse Proxy.

This is easy to setup in Apache, using the mod_proxy module.

The essential mod_proxy directive to setup a reverse proxy may be the ProxyPass. You'd typically add the next line for your local Apache configuration file (usually httpd.conf or apache2.conf):

ProxyPass     /remote/     http://www.mysite.com/

Within this situation, the browser could be asking for http://localhost/remote/test.php however your local Apache server would serve this by serving as a proxy to http://www.mysite.com/test.php.

You should also make certain to achieve the following configuration lines uncommented inside your Apache config file:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

Make certain to restart the local Apache service once you inflict changes towards the config file.