ruby - Can a Sinatra or Rack application find out if it is running with Apache or Thin? -


i trying silly automatic configuration of sinatra application allow use different sub uri depending whether run apache , passenger, or thin web server.

so question is: possible find out inside sinatra application web server runs it?

you can't (as far know) see if it's running on apache, can check if it's running on passenger:

if defined?(phusionpassenger)   # running passenger! end 

you should able same thin:

if defined?(thin)   # running thin! end 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -