Rails 2.3.15
The system may be run using mongrel or apache/passenger. Some functions
are not supported in mongrel 1.1.5 but work in apache/passengertherefore
I want to know what server is being used so I canalter behavior as
needed.
How can I determine in a controller which server is serving the system?
On Friday, July 5, 2013 5:48:00 AM UTC+1, Norm wrote:
Rails 2.3.15
The system may be run using mongrel or apache/passenger. Some functions
are not supported in mongrel 1.1.5 but work in apache/passenger therefore
I want to know what server is being used so I can alter behavior as
needed.
How can I determine in a controller which server is serving the system?
Pretty crude but you could check defined?(PhusionPassenger)
Thanks Frederick and Joel. Turns out SERVER_SOFTWARE is defined as
“Apache/2.2.14 (Ubuntu)” in the environment so I can use that and also
PhusionPassenger is defined when running under passenger so that would
work also. Both are fairly crude but they work and that is what I
need. I would prefer to know mongrel is running but that does not seem
as easy and this will work.
Norm
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.