You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bart Heinsius <bh...@gmail.com> on 2005/11/06 13:10:46 UTC

[users@httpd] Configuring apache as a gateway for another domain on another server

Hi,

I have two servers on my internal network with apache on them, lets
say m1 and m2.
I want to host two domains on my network, lets say www.d1.com and www.d2.com.
The router routes all external http requests to server m1.
External requests for www.d1.com should be processed by apache on server m1.
External requests for www.d2.com should be processed by apache on server m2.
How would I do this?
I googled around and looked on apache.org which directed met to
mod_proxy but I don't think that works in this situation.

Any help would be appreciated.

Regards,
Bart.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring apache as a gateway for another domain on another server

Posted by Bart Heinsius <bh...@gmail.com>.
Nick, can you point me in the right direction?
Regards,
Bart.

On 11/6/05, Nick Kew <ni...@webthing.com> wrote:
> On Sunday 06 November 2005 20:28, Michael D. Berger wrote:
> > If nothing else is suggested,
>
> I already said, the reverse proxy will do it easily.
>
> Sure, it's different to the examples in my article.  I didn't
> consider it necessary: it's altogether simpler to configure
> than the examples I present.
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring apache as a gateway for another domain on another server

Posted by Nick Kew <ni...@webthing.com>.
On Sunday 06 November 2005 20:28, Michael D. Berger wrote:
> If nothing else is suggested,

I already said, the reverse proxy will do it easily.

Sure, it's different to the examples in my article.  I didn't
consider it necessary: it's altogether simpler to configure
than the examples I present.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring apache as a gateway for another domain on another server

Posted by Tom Hoefakker <tw...@iw.net>.
Maybe a combination of mod_proxy and mod_rewrite is what you're looking for.

Something like this:

RewriteCond %{HTTP_HOST}  www.d1.com  [NC]
RewriteRule ^(.*) http://m1/$1 [P,L]
RewriteCond %{HTTP_HOST}  www.d2.com  [NC]
RewriteRule ^(.*) http://m2/$1 [P,L]

I don't have a lot of experience with mod_rewrite, so the syntax might 
not be quite right, but perhaps someone else can follow up with any 
corrections.

Tom



Michael D. Berger wrote:
> If nothing else is suggested, I think that this could be done
> with NetFilter (http://www.netfilter.org/).  Hopefully, something
> else will be suggested.
> Mike.
> 
> --
> Michael D. Berger
> m.d.berger@ieee.org 
> 
>> -----Original Message-----
>> From: Bart Heinsius [mailto:bheinsius@gmail.com] 
>> Sent: Sunday, November 06, 2005 9:14 AM
>> To: users@httpd.apache.org
>> Subject: Re: [users@httpd] Configuring apache as a gateway 
>> for another domain on another server
>>
>>
>> From what I read in the documentation, mod_proxy works for routing
>> requests for www.d1.com/myapp1 and www.d1.com/myapp2 (notice that both
>> url's are in the d1.com domain) to be served by different servers on
>> the internal network.
>>
>> What I want is to route requests for www.d1.com and www.d2.com to
>> different servers (notice the difference in domain names), where
>> www.d1.com and www.d2.com have the same ip address in the outside
>> world dns.
>>
>> With Virtual Hosts I can manage different domain names to be served
>> from different directories.
>> With mod_proxy I can manage different url's on the same domain to be
>> served by different servers.
>> I need a combination of both: different domain names being served by
>> different servers.
>>
>> Thanks,
>> Bart.
>>
>> On 11/6/05, Nick Kew <ni...@webthing.com> wrote:
>>> On Sunday 06 November 2005 12:10, Bart Heinsius wrote:
>>>> Hi,
>>>>
>>>> I have two servers on my internal network with apache on 
>> them, lets
>>>> say m1 and m2.
>>>> I want to host two domains on my network, lets say www.d1.com and
>>>> www.d2.com. The router routes all external http requests 
>> to server m1.
>>>> External requests for www.d1.com should be processed by 
>> apache on server
>>>> m1. External requests for www.d2.com should be processed 
>> by apache on
>>>> server m2. How would I do this?
>>>> I googled around and looked on apache.org which directed met to
>>>> mod_proxy but I don't think that works in this situation.
>>> mod_proxy is exactly what you need.  see also
>>> http://www.apacheweek.com/features/reverseproxies
>>>
>>> --
>>> Nick Kew
>>>
>>>
>> ---------------------------------------------------------------------
>>> The official User-To-User support forum of the Apache HTTP 
>> Server Project.
>>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP 
>> Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Configuring apache as a gateway for another domain on another server

Posted by "Michael D. Berger" <m....@ieee.org>.
If nothing else is suggested, I think that this could be done
with NetFilter (http://www.netfilter.org/).  Hopefully, something
else will be suggested.
Mike.

--
Michael D. Berger
m.d.berger@ieee.org 

> -----Original Message-----
> From: Bart Heinsius [mailto:bheinsius@gmail.com] 
> Sent: Sunday, November 06, 2005 9:14 AM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Configuring apache as a gateway 
> for another domain on another server
> 
> 
> From what I read in the documentation, mod_proxy works for routing
> requests for www.d1.com/myapp1 and www.d1.com/myapp2 (notice that both
> url's are in the d1.com domain) to be served by different servers on
> the internal network.
> 
> What I want is to route requests for www.d1.com and www.d2.com to
> different servers (notice the difference in domain names), where
> www.d1.com and www.d2.com have the same ip address in the outside
> world dns.
> 
> With Virtual Hosts I can manage different domain names to be served
> from different directories.
> With mod_proxy I can manage different url's on the same domain to be
> served by different servers.
> I need a combination of both: different domain names being served by
> different servers.
> 
> Thanks,
> Bart.
> 
> On 11/6/05, Nick Kew <ni...@webthing.com> wrote:
> > On Sunday 06 November 2005 12:10, Bart Heinsius wrote:
> > > Hi,
> > >
> > > I have two servers on my internal network with apache on 
> them, lets
> > > say m1 and m2.
> > > I want to host two domains on my network, lets say www.d1.com and
> > > www.d2.com. The router routes all external http requests 
> to server m1.
> > > External requests for www.d1.com should be processed by 
> apache on server
> > > m1. External requests for www.d2.com should be processed 
> by apache on
> > > server m2. How would I do this?
> > > I googled around and looked on apache.org which directed met to
> > > mod_proxy but I don't think that works in this situation.
> >
> > mod_proxy is exactly what you need.  see also
> > http://www.apacheweek.com/features/reverseproxies
> >
> > --
> > Nick Kew
> >
> > 
> ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP 
> Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring apache as a gateway for another domain on another server

Posted by Bart Heinsius <bh...@gmail.com>.
>From what I read in the documentation, mod_proxy works for routing
requests for www.d1.com/myapp1 and www.d1.com/myapp2 (notice that both
url's are in the d1.com domain) to be served by different servers on
the internal network.

What I want is to route requests for www.d1.com and www.d2.com to
different servers (notice the difference in domain names), where
www.d1.com and www.d2.com have the same ip address in the outside
world dns.

With Virtual Hosts I can manage different domain names to be served
from different directories.
With mod_proxy I can manage different url's on the same domain to be
served by different servers.
I need a combination of both: different domain names being served by
different servers.

Thanks,
Bart.

On 11/6/05, Nick Kew <ni...@webthing.com> wrote:
> On Sunday 06 November 2005 12:10, Bart Heinsius wrote:
> > Hi,
> >
> > I have two servers on my internal network with apache on them, lets
> > say m1 and m2.
> > I want to host two domains on my network, lets say www.d1.com and
> > www.d2.com. The router routes all external http requests to server m1.
> > External requests for www.d1.com should be processed by apache on server
> > m1. External requests for www.d2.com should be processed by apache on
> > server m2. How would I do this?
> > I googled around and looked on apache.org which directed met to
> > mod_proxy but I don't think that works in this situation.
>
> mod_proxy is exactly what you need.  see also
> http://www.apacheweek.com/features/reverseproxies
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring apache as a gateway for another domain on another server

Posted by Nick Kew <ni...@webthing.com>.
On Sunday 06 November 2005 12:10, Bart Heinsius wrote:
> Hi,
>
> I have two servers on my internal network with apache on them, lets
> say m1 and m2.
> I want to host two domains on my network, lets say www.d1.com and
> www.d2.com. The router routes all external http requests to server m1.
> External requests for www.d1.com should be processed by apache on server
> m1. External requests for www.d2.com should be processed by apache on
> server m2. How would I do this?
> I googled around and looked on apache.org which directed met to
> mod_proxy but I don't think that works in this situation.

mod_proxy is exactly what you need.  see also
http://www.apacheweek.com/features/reverseproxies

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org