1

I am no server admin, just a web developer trying to act as such. :)

We have website A and website B. Website A has a subdomain called subby.websitea.com, which connects via A name to ANOTHER server. I was told that in order to make subby.websitea.com APPEAR as a subFOLDER of website A (ie. websitea.com/subby/) than a reverse proxy is needed.

well, I've been looking at documentation all night and I just.... I don't get the basics! My host was kind enough to set up our VPS with the info outlined here: http://www.apachetutor.org/admin/reverseproxies

But... then what!? How do I make this work? Do I now edit the htaccess file? I haven't found a good simple explanation of how it works. I love learning, but I think I have to get over this basic hump first.... :)

PaulHanak
  • 729
  • 2
  • 9
  • 21

2 Answers2

4

Since it's part (or all of it?) of your question, a reverse proxy is basically a gateway, or intermediary between a server and its clients. Requests are sent to the reverse proxy, and it (the reverse-proxy) forwards them to the server.
There are lots of other features on a reverse, like load-balancing and caching. I guess a Google search should point you to more resources and documentations on the matter.

As I understand it, you have two websites (subby.websitea.com / www.websitea.com) and you want 'www.websitea.com/subby' to forward to "subby.websitea.com".

EDITED PART: You have access to Apache config, so you need to enable mod_proxy and mod_proxy_http in httpd.conf. Then uncomment

Include extra/httpd-vhost.conf

(in http.conf, at the end of the file).

You must then edit the httpd-vhost.conf file to add your proxy directives.

<VirtualHost *:80>
/* Other default config like Documentroot, etc */
ProxyRequests Off
ProxyPass /subby/ http://subby.websitea.com/
ProxyPassReverse /subby/ http://subby.websitea.com/
</VirtualHost>

Now, everything that comes in http://www.websitea.com/subby/ would be forwarded to http://subby.websitea.com without the adress getting altered.

EDIT AGAIN: I forgot to say: remember to restart Apache each time you change something in the .conf files.

Hope this helps.

Nicolas BRERO
  • 505
  • 5
  • 6
  • Hey, thank you for the attempt, but it didn't really answer my question. :P I DID say I have a VPS, so yes, I have full control over the apache and everything in it. And I also posted that same exact link you did. And yes, it told me "configurations", but it didnt say what to DO with those configurations. I believe you have it backwards though. I do NOT want the subdomain... THIS is what I want to accomplish: http://www.seomoz.org/blog/what-is-a-reverse-proxy-and-how-can-it-help-my-seo – PaulHanak Feb 14 '12 at 13:36
  • I'm embarrassed I misread two important points in your question and I'm sorry for it. I'm editing my previous answer right now. – Nicolas BRERO Feb 14 '12 at 14:42
  • haha, no problem. I guess I need to learn how to use shell access, don't I? lol. Im going to go ahead and vote you up on this one and give her the ole college try. – PaulHanak Feb 14 '12 at 19:30
0

Enable mod_proxy and mod_proxy_http

# a2enmod proxy_http this should also enable mod_proxy as a dependency.

Create a new VirtualHosts file /etc/apache2/sites-available/subby.websitea.com with the content:

<virtualhost *>
  ServerName subby.websitea.com
  ProxyRequests off
  ProxyPass / http://192.168.1.15/
  ProxyPassReverse / http://192.168.1.15/
</virtualhost>

Enable the new site:

a2ensite subby.websitea.com

Reload Apache:

service apace2 reload

Done.

Qsiris
  • 1,143
  • 1
  • 13
  • 27