Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th August 2009, 15:32
seaders seaders is offline
Junior Member
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Serving from multiple servers mod_rewrite, mod_proxy or mod_alias?

Hi guys, I'm the admin of a few networked computers and would like to set up a nice clean setup for my system.

So, I've a domain name, which gets pointed to server1. Then I've got a few users and their files on server2. I've then got a few other applications and things on server3.

Now, what's currently happening is when anyone goes to www.mydomain.com, they get the default configuration in apache, on server1. If they go to www.mydomain.com/~myname, they get mod_rewritten to server2.mydomain.com/~myname and the same setup if anyone goes to www.mydomain.com/apps. Now, this currently works perfectly, but I would much prefer the setup of the machines to be a lot nicer, ie the hierarchy stays hidden and when you go to www.mydomain.com/~myname, the files from server2 get served to you, but the url in your browser stays at www.mydomain.com, instead of going to server2.mydomain.com.

I can't seem to find a way to do this with mod_rewrite, or mod_alias, so I think mod_proxy is the way to go, but I'm not 100% sure. The way I understand mod_proxy works would mean that a lot of the load of serving the files and applications on server2 & 3 would be taken on by server 1, which I don't want. Am I correct in this assumption, or would mod_proxy work for what I want?

All help and info is hugely appreciated.
Reply With Quote
Sponsored Links
  #2  
Old 17th August 2009, 18:04
seaders seaders is offline
Junior Member
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, I've used rewriterule to do this, with the [P] flag and it seems to be working really nicely, but there's a problem where every now and again, server2's address comes up in the browser's URL bar. it'll change the URL the first time, but not the second. anyone any idea why?
Reply With Quote
  #3  
Old 17th August 2009, 19:47
seaders seaders is offline
Junior Member
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

never mind again, there's an option for apache that is "ProxyPreserveHost On" which ensures that the URL you put into the browser stays there. all good now.
Reply With Quote
Reply

Bookmarks

Tags
apache, mod_alias, mod_proxy, mod_rewrite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to host a forum with multiple web servers? itwillcome Technical 3 11th February 2011 01:26
Multiple Servers ahagadorn Developers' Forum 5 9th February 2010 14:38
ISPConfig 3.0.0.5 on Multiple Servers diablorick Installation/Configuration 13 10th October 2009 15:14
Unable send receive emails vassilis3 Installation/Configuration 15 19th May 2007 14:34
Multiple name servers? webking General 1 13th April 2007 09:24


All times are GMT +2. The time now is 09:18.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.