Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
setting up a reverse proxy in ubuntu 10.04.4 and apache2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
johnmerlino
n00b
n00b


Joined: 21 Feb 2012
Posts: 3

PostPosted: Wed Feb 22, 2012 12:00 am    Post subject: setting up a reverse proxy in ubuntu 10.04.4 and apache2 Reply with quote

Hey all,

I am using Ubuntu 10.04.4 and apache2. I came across two inconsistent tutorials on how to set up a reverse proxy:

http://blog.janjonas.net/2010-10-09/debian-ubuntu-apache_2-transparent-reverse-proxy-mod_proxy

http://blog.lundscape.com/2009/05/configure-a-reverse-proxy-with-apache/

http://ubuntuguide.org/wiki/Apache2_reverse_proxies

Those are three different tutorials with three different approaches.


First tutorial says to run sudo a2enmod proxy and sudo a2enmod proxy_http and then change virtual host like this:

<VirtualHost *:80>

ServerName your-public-domain.com

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://your-private-domain.com/
ProxyPassReverse / http://your-private-domain.com/

</VirtualHost>

Second tutorial says run a2enmod proxy_http and change the virtual host to this:

ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass /subsonic/ http://localhost:8180/subsonic/
ProxyPassReverse /subsonic/ http://localhost:8180/subsonic/

Note in the second tutorial they introduce the ProxyRequests and ProxyPreserveHost directives whereas in the first tutorial they dont. First tutorial introduces ServerName directive whereas the second tutorial doesnt.

What I am personally trying to do is as follows:

when on site abc.com, when I click a link to site auto.efg.com, the browser will load the application on auto.efg.com while mainitaing abc.com on address bar of browser. So if I want to go to auto.efg.com/users/sign_in, then I want to see abc.com/users/sign_in on the address bar.

thanks for any response
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13764

PostPosted: Wed Feb 22, 2012 2:32 am    Post subject: Reply with quote

Could you explain why you want the address bar to be wrong? Although users are generally not good about checking the URL bar, actively misrepresenting the origin of the content seems like a really bad idea. You might get this to work if you convinced the proxy to rewrite efg.com links to appear as abc.com links, then rewrote requests back to the original domain. However, this would be fragile, since the proxy cannot reliably rewrite links created through client side scripting.
Back to top
View user's profile Send private message
johnmerlino
n00b
n00b


Joined: 21 Feb 2012
Posts: 3

PostPosted: Wed Feb 22, 2012 2:39 pm    Post subject: Reply with quote

Because these are two different servers, completely different servers hosted by two different companies. We want the url to show one ip but load files from another. Otherwise we would have to install ruby on rails and the like on the other server and thats not happening.
Back to top
View user's profile Send private message
johnmerlino
n00b
n00b


Joined: 21 Feb 2012
Posts: 3

PostPosted: Wed Feb 22, 2012 3:14 pm    Post subject: Reply with quote

Hu wrote:
Could you explain why you want the address bar to be wrong? Although users are generally not good about checking the URL bar, actively misrepresenting the origin of the content seems like a really bad idea. You might get this to work if you convinced the proxy to rewrite efg.com links to appear as abc.com links, then rewrote requests back to the original domain. However, this would be fragile, since the proxy cannot reliably rewrite links created through client side scripting.


thanks for response, do you have an example of the type of rewriting that needs to be done?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10220
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Feb 22, 2012 5:15 pm    Post subject: Reply with quote

Moved from Portage & Programming to Unsupported Software. Not about Gentoo so it fits better here.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum