I have one admin-like server that provides information that is used
across a suite of other servers that provide various client-facing
services. In order to synchronize changes to ...

As I was typing, I realized that I was approaching the problem from
the wrong direction. Instead of providing the address from the client-
facing server, the admin-like server could get the address from the
request. Thanks for saying just enough.

On Sep 25, 4:18 am, bill walton <bwalton...@gmail.com> wrote:
> Hi John,
>
> On Thu, 2009-09-24 at 10:22 -0700, johnr wrote:
> > In the environment.rb I need to use the port number that the server is
> > being started under in an after_initialize block in order to register
> > my server with another server. I've looked in config
> > (Rails:Configuration) and ENV, but It doesn't look to be there. I know
> > that a workaround would be to set a PORT environment variable and use
> > that on the command line, for example. But I would rather use an
> > already existent method.
>
> On a request-by-request basis you can test request.host_with_port. But,
> AFAIK, Rails is unaware of the port used by the web server until that
> server makes a request.  If it were otherwise, it would be difficult to
> run a pack of mongrels in front of the app.  Perhaps if you said more
> about what you mean by 'register my server with another server', we
> could be more help.
>
> HTH,
> Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to