Same domain, different pages
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Web Servers on Unix and Linux > Same domain, different pages




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Same domain, different pages  
Patrick Cossette


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 10:48 PM

Hi,

I am setting up 2 web servers with Apache 2 :

- both servers will respond to the same HTTP_HOST, which is www.foo.com,
but my DNS will point www to only one of those 2 servers (let's call it
server #1)

- each of the 2 servers will serve different pages.  Server #1 will have
about 20 directories under DocumentRoot as well as a few Alias directives,
which he will happily serve:
www.foo.com/directory1
www.foo.com/directory2
www.foo.com/directory3
..
..
..
www.foo.com/directory20
www.foo.com/alias1
www.foo.com/alias2

- when server #1 gets a request for something else than those directories
and aliases, I want it to redirect the request to server #2.  If possible
(but that's not mandatory), I do not want the user in front of the browser
to know that it is redirected to another server, so a request for
www.foo.com/otherdirectory will show that very address
(www.foo.com/otherdirectory) in the address bar, even though the page is
served from server #2, which is not really www.

How can I do that?  I thought of using rewrite maps on server #1, or using a
script as the ErrorDocument for 404 errors on server #1, but am unsure if
there are better ways of doing it.  I want good performance too.

Thank you.

Patrick C.
email: pcossette@aei.ca







[ Post a follow-up to this message ]



    Re: Same domain, different pages  
DvDmanDT


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-20-04 10:48 PM

Maybe you can make mod_alias work first, then mod_proxy, then use proxypass
/ and make aliases of all those dirs... It's a solution, even if it's not a
clean one.. You could script it I suppose.. ErrorDocument 404 /script.php
and then making a frameset with one frame pointing to the other server?

--
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"Patrick Cossette" <pcossette@aei.ca> skrev i meddelandet
news:cl3rfg$jid$1@Tropolix.UQSS.UQuebec.CA...
> Hi,
>
> I am setting up 2 web servers with Apache 2 :
>
>   - both servers will respond to the same HTTP_HOST, which is www.foo.com,
> but my DNS will point www to only one of those 2 servers (let's call it
> server #1)
>
>   - each of the 2 servers will serve different pages.  Server #1 will have
> about 20 directories under DocumentRoot as well as a few Alias directives,
> which he will happily serve:
>               www.foo.com/directory1
>               www.foo.com/directory2
>               www.foo.com/directory3
>                            ...
>                            ...
>                            ...
>               www.foo.com/directory20
>               www.foo.com/alias1
>               www.foo.com/alias2
>
>   - when server #1 gets a request for something else than those
directories
> and aliases, I want it to redirect the request to server #2.  If possible
> (but that's not mandatory), I do not want the user in front of the browser
> to know that it is redirected to another server, so a request for
> www.foo.com/otherdirectory will show that very address
> (www.foo.com/otherdirectory) in the address bar, even though the page is
> served from server #2, which is not really www.
>
> How can I do that?  I thought of using rewrite maps on server #1, or using
a
> script as the ErrorDocument for 404 errors on server #1, but am unsure if
> there are better ways of doing it.  I want good performance too.
>
> Thank you.
>
> Patrick C.
> email: pcossette@aei.ca
>
>







[ Post a follow-up to this message ]



    Re: Same domain, different pages  
lars@nospam.nosoftwarepatents.edu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-21-04 12:47 PM

If they both have the same name, I'm not quite sure how it'd be done, but
otherwise, I'd suggest using a redirect:

http://httpd.apache.org/docs-2.0/mo...l#redirectmatch
http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html

Perhaps some articles on load balancing might have some more useful
suggestions.

--
Lars
"Chances are that patents on software ... in fact stifle
innovation. Europe could still alter course"
http://www.nosoftwarepatents.com/en/m/intro/





[ Post a follow-up to this message ]



    Re: Same domain, different pages  
Patrick Cossette


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-22-04 10:49 PM

Thank you for your answers.  You're right Lars, if both servers had not the
same name, I would use rewrites and it would be easy.  But since I want to
use the same name for both servers, I'll continue to explore mod_alias,
ErrorDocuments and thank you DvDmanDT for pointing me to mod_proxy, I might
use it.  It will be a solution not very clean, but it should work.  I'll
have to see what kind performance I get with this setup.

Thanks again.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:42 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register