Interfacing with the Web Server with Rack
Rails runs your application in the context of a web server. So far, we have used two separate web servers: Puma, which run standalone, and Phusion Passenger, which integrates with the Apache HTTP web server.
A number of other choices are available, including Mongrel, Lighttpd, Unicorn, and Thin.
Based on this, you might come to the conclusion that Rails has code that allows it to plug into each of these web servers. In earlier releases of Rails, this was true; as of Rails 2.3, this integration was delegated to a gem named Rack.
So, Rails integrates with Rack, Rack integrates with (for example) Passenger, and Passenger integrates with Apache httpd.
Although generally this integration is invisible ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access