Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

multi-homed application and proxy configuration

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


cbouvi at free

Feb 9, 2007, 1:40 AM

Post #1 of 3 (532 views)
Permalink
multi-homed application and proxy configuration

I'm trying to achieve the following setup (with apache+mod_perl)
- one server in front: http://front/myapp, serving the static content
and proxying for several instances in the back-end.
- several instances of the application in the back-end, but each with a
different purpose. i.e., the user knows what instance he wants to
reach, and says so in the URL:
- http://front/myapp/A/...
- http://front/myapp/B/...

The aim is to be able to split the load on different machines, if need
be. However, currently, there is no such need, so A and B would be
hosted on the same machine, possibly even the front-end machine.

So I'd need to install one Catalyst app that can be reached either as
/myapp, /myapp/A or /myapp/B. And it should somehow "know" through which
path it has been accessed (because it's behaviour will be slightly
different whether it's A or B).

I already tried with mod_rewrite and [P], but then uri_for() still
refers to /myapp on the back-end server (not /myapp/A on the front-end).
I know I read everywhere that under mod_perl, it should Just Work, well
it bloody well doesn't! I have to resign to messing around with
$c->req->base, but it's not dynamic: I can set it to a string read from
the config, but I couldn't figure out how to determine what the original
request was aimed at (was it /A? /B?).

I guess I failed to understand something in mod_proxy or Catalyst
configuration, but I also failed at finding the documentation that
explains how to do that. If someone can point me in the right
direction... Please?

--
C é d r i c B o u v i e r
Attachments: signature.asc (0.18 KB)


pharkins at gmail

Feb 9, 2007, 5:17 AM

Post #2 of 3 (483 views)
Permalink
Re: multi-homed application and proxy configuration [In reply to]

On 2/9/07, Cédric Bouvier <cbouvi [at] free> wrote:
> So I'd need to install one Catalyst app that can be reached either as
> /myapp, /myapp/A or /myapp/B. And it should somehow "know" through which
> path it has been accessed (because it's behaviour will be slightly
> different whether it's A or B).

It sounds to me like you want virtual hosts. You can check the host
header to see which one you're in, or use PerlSetVar inside the
VirtualHost block to set a perl variable indicating which one.

- Perrin

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


moseley at hank

Feb 9, 2007, 7:45 AM

Post #3 of 3 (483 views)
Permalink
Re: multi-homed application and proxy configuration [In reply to]

On Fri, Feb 09, 2007 at 10:40:39AM +0100, Cédric Bouvier wrote:
> So I'd need to install one Catalyst app that can be reached either as
> /myapp, /myapp/A or /myapp/B. And it should somehow "know" through which
> path it has been accessed (because it's behaviour will be slightly
> different whether it's A or B).

Do you mean that a both front end requests, /myapp/A and /myapp/B, both
request just /myapp/ on the back end server?

I assume so because otherwise you have the pat to test.

If so, that's similar to the problem with SSL where the front end
server proxies the same path to the backend. How does the backend
know to make a http or https url with uri_for()?

What I do is have the Cat application listen on different ports so the
Cat application knows if it was an ssl request based on the port the
request comes in on.


--
Bill Moseley
moseley [at] hank


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.