Forum Moderators: phranque
So far I have tried setting up NAT with port addressing on my router, so one machine is www.mydomain.com and the other is www.mydomain.com:8000, but that's confusing to ordinary users.
I also tried pointing all port 80 traffic to mars, and in mars's httpd.conf redirecting venus.mydomain.com to venus by internal IP address, but then the user sees that internal IP in the URL and cannot bookmark it.
Don't lots of geeks with multiple computers do this same thing? Do you have to set up one machine as a DNS server or something? Having skimmed the DNS docs, I hesitate to delve into DNS unless it's really the right thing.
Common reverse proxies for windows/linux are "Microsoft Proxy Server" (or whatever it's now called), Apache's mod_proxy, and squid.
On my Mars machine, which is the port 80 server to the outside world, I enabled mod_proxy. Then at the bottom of the VirtualHost block for mysite.com I put the following two lines:
ProxyPass /test/ http://venus/test/
ProxyPassReverse /test/ http://venus/test/
Requests to http://www.example.com/test should now be routed to http://venus/test. But what happens is I get a Forbidden error on the browser. It looks like the server on mars is trying to pass the request, because browsing to a nonexistent location like http://www.example.com/bogus gives a Not Found error instead. I can browse to http://venus/test directly with no error. What is getting in the way?
[edited by: jdMorgan at 1:15 pm (utc) on April 18, 2006]
[edit reason] example.com, de-linked. [/edit]
<Proxy *>
Order deny,allow
Allow from .myvirtualhost.com
#Deny from all
</Proxy>
The <VirtualHost> block for that host contains these lines:
ProxyPass /test/ http://venus/test/
ProxyPassReverse /test/ http://venus/test/
With these settings, requests for the /test folder on my outside-facing web server (mars) are transparently routed to the venus web server.
I still want to work out how to combine mod_rewrite and mod_proxy to route an url like http://xyz.example.com to http://otherserver/xyz, but in the meantime this will work fine.
[edited by: jdMorgan at 1:16 pm (utc) on April 18, 2006]
[edit reason] example.com, de-linked. [/edit]
I still want to work out how to combine mod_rewrite and mod_proxy to route an url like http://xyz.example.com to http://otherserver/xyz, but in the meantime this will work fine.
This search [google.com] should get you going on that subject.
Jim