Deploying Rails Applications

Total Page:16

File Type:pdf, Size:1020Kb

Deploying Rails Applications What readers are saying about Deploying Rails Applications Deploying Rails Applications is a fantastic and vastly important book. Many thanks! Stan Kaufman Principal, The Epimetrics Group LLC I’ve used the section on setting up a virtual private server to get up and running on three different VPS instances in less than thirty min- utes each. Your book has saved me days of time preparing servers, letting me focus instead on writing code. Your book also has the best Capistrano tutorial I’ve ever read. It’s no longer a mystery, and I’m now writing custom deployment tasks. I can’t wait to get my final copy! Barry Ezell CTO, Balance Engines LLC Prior to buying this book, I had to spend hours scouring the Web to find this kind of information. Having it all in one place (and correct!) helped me deliver a successful Rails project. Thank you! Eric Kramer Programmer, Nationwide Children’s Hospital Deploying Rails Applications A Step-by-Step Guide Ezra Zygmuntowicz Bruce A. Tate Clinton Begin with Geoffrey Grosenbach Brian Hogan The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas Many of the designations used by manufacturers and sellers to distinguish their prod- ucts are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC. Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein. Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://www.pragprog.com Copyright © 2008 Ezra Zygmuntowicz, Bruce A. Tate, and Clinton Begin. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmit- ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. ISBN-10: 0-9787392-0-5 ISBN-13: 978-09787392-0-1 Printed on acid-free paper with 50% recycled, 15% post-consumer content. Contents 1 Introduction 8 1.1 TheLay oftheLand ..................... 11 1.2 Finding a Home ....................... 13 1.3 Conventions ......................... 17 1.4 Acknowledgments ...................... 17 2 Refining Applications for Production 20 2.1 TheLay oftheLand ..................... 21 2.2 Source Code Management ................. 22 2.3 Subversion Tips ....................... 29 2.4 Stabilizing Your Applications ............... 31 2.5 Active Record Migrations .................. 34 2.6 Application Issues for Deployment ............ 38 3 Shared Hosts 44 3.1 TheLay oftheLand ..................... 44 3.2 Choosing a Shared Host .................. 46 3.3 Setting Up Your Domain and DNS ............ 49 3.4 Configuring Your Server .................. 51 3.5 Server Setup: Create a Database ............. 52 3.6 Installing Your Application ................. 53 3.7 Configuring Your Web Server ............... 56 3.8 Application Setup: Rails Config Files ........... 60 3.9 The Well-Behaved Application ............... 63 3.10 Troubleshooting Checklist ................. 64 3.11 Conclusion .......................... 71 4 Virtual and Dedicated Hosts 72 4.1 TheLay oftheLand ..................... 72 4.2 Virtual Private Servers ................... 75 4.3 Dedicated Servers ...................... 77 4.4 SettingUp Shop ....................... 78 4.5 Conclusion .......................... 90 CONTENTS 6 5 Capistrano 92 5.1 TheLay oftheLand ..................... 93 5.2 How It Works ......................... 95 5.3 Local and Remote Setup for Rails ............. 97 5.4 Standard Recipes ...................... 107 5.5 Writing Tasks ........................ 108 5.6 A Little Extra Flavor ..................... 118 5.7 Troubleshooting ....................... 121 5.8 Conclusion .......................... 123 6 Managing Your Mongrels 124 6.1 TheLay oftheLand ..................... 124 6.2 Training Your Mongrels .................. 124 6.3 Configuring the Watchdog ................. 131 6.4 Keeping FastCGI Under Control .............. 136 6.5 Building in Error Notification ............... 138 6.6 Heartbeat ........................... 142 6.7 Conclusion .......................... 143 7 Scaling Out 144 7.1 TheLay oftheLand ..................... 144 7.2 Scaling Out with Clustering ................ 145 7.3 Mirror Images ........................ 150 7.4 Domain Names and Hosts ................. 151 7.5 Deploying to Multiple Hosts ................ 154 7.6 Apache ............................ 159 7.7 nginx, from Russia with Love ............... 172 7.8 Clustering MySQL ...................... 179 7.9 Summary ........................... 191 8 Deploying on Windows 192 8.1 Setting Up the Server .................... 192 8.2 Mongrel ............................ 196 8.3 Mongrel and Pen ...................... 201 8.4 Using Apache 2.2 and Mongrel .............. 204 8.5 IIS Integration ........................ 209 8.6 Reverse Proxy and URLs .................. 211 8.7 Strategies for Hosting Multiple Applications . 213 8.8 Load-Testing Your Applications .............. 218 8.9 Final Thoughts ....................... 219 8.10 Developing on Windows and Deploying Somewhere Else 220 8.11 Wrapping Up ......................... 223 CONTENTS 7 9 Performance 224 9.1 TheLay oftheLand ..................... 224 9.2 Initial Benchmarks: How Many Mongrels? ........ 228 9.3 Profiling and Bottlenecks .................. 232 9.4 Common Bottlenecks .................... 237 9.5 Caching ............................ 242 9.6 Conclusion .......................... 252 10 Frontiers 254 10.1 Yarv .............................. 254 10.2 Rubinius ........................... 254 10.3 JRuby ............................. 256 10.4 IronRuby ........................... 256 10.5 Wrapping Up ......................... 257 A An Example nginx Configuration 258 B Bibliography 260 Index 261 Chapter 1 Introduction Building Rails apps brings the joy back into development. But I, Ezra, have a confession to make. There was a brief moment that I didn’t like Rails at all. I’d just graduated from the five-minute tutorial to developing my first real Rails application. The helpers, plug-ins, and generators reduced the amount of code I needed to write. The logical organization and lay- out of the files let me painlessly find what I needed, and the domain- specific languages in Active Record let me express my ideas with sim- plicity and power. The framework bowed to my will, and aside from a few trivial mistakes, I finished the app. Pure joy washed over me. But then, it was time to deploy. Deployment means moving your appli- cation from a development environment into a home that your cus- tomers can visit. For a web application, that process involves choosing a host, setting up a web server and database, and moving all your files to the right places with the right permissions. I quickly discovered that after the joy of development, deployment was a real drag. All those waves of euphoria completely disintegrated against the endless stream of crash logs, Rails error pages, and futile install scripts. I spent hours wading through the Rails wikis, blogs, and books for answers, but each one gave me a mere fragment of what I needed. Much of the information I found was contradictory or flat-out wrong. Deployment also involves making the best possible environment for your customers, once you’ve settled into your new home. There, too, I failed miserably. When I finally made my site work, it was too slow. Stumbling through page caching seemed to make no difference, and CHAPTER 1. INTRODUCTION 9 my end users watched the spinning (lack of) progress indicator in frus- tration. I struggled to fix memory leaks, broken database migrations, and worthless server configurations until eventually my site purred in appreciation. Then came success, which means more visitors, followed by more failure. I screamed some choice words that would make a sailor’s dead parrot blush. No, at that moment, I really didn’t like Rails. I’m not going to sugarcoat it. If you don’t know what you’re doing, Rails deployment can stretch the limits of your patience, even endurance. What’s worse, Rails deployment suffers especially in areas where Rails development is easy: • You can always find plenty of Rails development documentation, but when it’s time to deploy, you can often find only a fraction of what you need. People just seem to write more about development than deployment. • You can choose your development platform, but you can’t always choose your deployment platform. Most hosts with Rails support run some variant of Linux; others run FreeBSD or Solaris. And the software stack for different hosts can vary wildly, as can applica- tion requirements. • When your development application breaks, you can find moun- tains of information through breakpointing, rich development logs, and the console. In production, when things go south, there are fewer sources of information, more users, and more variables. You might encounter a problem with the operating system, your application server, system resources, plug-ins,
Recommended publications
  • Resin 3.2 Reference
    Contents 1 Overview 3 1.1 Features - Resin and Resin Professional . .3 2 Installation 11 2.1 Resin Installation Quick Start . 11 2.2 Resin Installation . 16 2.3 Resin Web Server . 16 2.4 Resin with Apache . 22 2.5 Resin with IIS . 34 2.6 How the Plugins Dispatch to Resin . 44 3 Command-Line 47 3.1 Command-Line Configuration . 47 4 Admin Guide 51 4.1 User Guide: Administration . 51 5 Watchdog 63 5.1 Resin Watchdog . 63 6 Virtual Hosts 73 6.1 Virtual Hosting . 73 7 Clustering 89 7.1 Resin Clustering . 89 8 Web Applications 109 8.1 An Overview of Web Applications . 109 9 Logging 137 9.1 Log . 137 10 Administration 163 10.1 Resin Administration . 163 1 CONTENTS 11 Deployment 177 11.1 Packaging/Deployment . 177 12 Proxy Caching 181 12.1 Server Caching . 181 13 Quercus 193 13.1 Quercus: PHP in Java . 193 14 Security 217 14.1 Resin Security . 217 15 Inversion of Control 271 15.1 Resin IoC . 271 15.2 Scheduled Task . 308 16 Amber 327 16.1 Amber . 327 17 Embedding Resin 355 17.1 Embedding Resin . 355 18 Filters 367 18.1 Filters . 367 19 BAM 379 19.1 BAM . 379 20 Comet 405 20.1 Comet/Server-Push Servlet . 405 21 Remoting 411 21.1 Resin Remoting . 411 21.2 Hessian . 417 22 Messaging 423 22.1 Resin Messaging . 423 23 JSF - Java Server Faces 435 23.1 JSF - Java Server Faces . 435 24 Configuration Tags 445 24.1 cluster: Cluster tag configuration .
    [Show full text]
  • Civil Good: a Platform for Sustainable and Inclusive Online Discussion
    Civil Good: A Platform For Sustainable and Inclusive Online Discussion An Interactive Qualifying Project submitted to the faculty of Worcester Polytechnic Institute In partial fulfillment of the requirements for the degree of Bachelor of Science by: Steven Malis (Computer Science), Tushar Narayan (Computer Science), Ian Naval (Computer Science), Thomas O'Connor (Biochemistry), Michael Perrone (Physics and Mathematics), John Pham (Computer Science), David Pounds (Computer Science and Robotics Engineering), December 19, 2013 Submitted to: Professor Craig Shue, WPI Advisor Alan Mandel, Creator of the Civil Good concept Contents 1 Executive Summary1 1.1 Overview of Recommendations......................2 2 Authorship5 3 Introduction 10 3.1 Existing Work - Similar Websites.................... 11 4 Psychology 17 4.1 Online Disinhibition........................... 17 4.2 Format of Discussions.......................... 22 4.3 Reducing Bias with Self-Affirmation................... 28 4.4 Other Psychological Influences...................... 34 5 Legal Issues 38 5.1 Personally Identifiable Information................... 38 5.2 Intellectual Property........................... 42 5.3 Defamation................................ 45 5.4 Information Requests........................... 46 5.5 Use by Minors............................... 49 5.6 General Litigation Avoidance and Defense............... 51 6 Societal Impact 52 6.1 Political Polarization........................... 52 6.2 Minority Opinion Representation.................... 55 6.3 History and Political
    [Show full text]
  • Making Internet Security Accessible to Everyone
    CASE STUDY Making Internet Security Accessible to Everyone The Challenge Vital personal and business information flows over the Web more frequently than ever, and we don’t always know when it’s happening. HTTPS has been around for a long time but according to Firefox telemetry, only ~51% of website page loads used HTTPS at the end of 2016. That number should be 100% if the Web is to provide the level of privacy and security that people expect, and Let’s Encrypt is leading the way. ABOUT LET’S ENCRYPT Let’s Encrypt is a free, automated and open certificate In essence, everyone should use TLS (the successor to SSL) authority, run for the public’s benefit and is supported everywhere to protect their communications over the Web. Every organizationally by The Linux Foundation. The objective browser in every device supports it. Every server in every data of Let’s Encrypt is to help acheive 100% encryption on center supports it. the Web. Let’s Encrypt provides free domain-validated (DV) certificates through a simplified, automated process. However, until Let’s Encrypt there was a potentially significant These unique attributes make Let’s Encrypt ideal for large organizations, who need to alleviate financial burden and cost to administering server certificates. Let’s Encrypt is a free automate deployment at scale. Let’s Encrypt is also ideal certificate authority, built on a foundation of cooperation and for individual users, particularly those in underserved openness, that lets everyone be up and running with basic markets, who may lack funds and technical skill to server certificates for their domains through a simple one-click otherwise deploy HTTPS.
    [Show full text]
  • Systemd – Easy As 1, 2, 3
    Systemd – Easy as 1, 2, 3 Ben Breard, RHCA Solutions Architect, Red Hat [email protected] Agenda ● Systemd functionality ● Coming to terms ● Learning the basics ● More advanced topics ● Learning the journal ● Available resources 2 Systemd is more than a SysVinit replacement 3 Systemd is a system and service manager 4 Systemd Overview ● Controls “units” rather than just daemons ● Handles dependency between units. ● Tracks processes with service information ● Services are owned by a cgroup. ● Simple to configure “SLAs” based on CPU, Memory, and IO. ● Properly kill daemons ● Minimal boot times ● Debuggability – no early boot messages are lost ● Easy to learn and backwards compatible. 5 Closer look at Units 6 Systemd - Units ● Naming convention is: name.type ● httpd.service, sshd.socket, or dev-hugepages.mount ● Service – Describe a daemon's type, execution, environment, and how it's monitored. ● Socket – Endpoint for interprocess communication. File, network, or Unix sockets. ● Target – Logical grouping of units. Replacement for runlevels. ● Device – Automatically created by the kernel. Can be provided to services as dependents. ● Mounts, automounts, swap – Monitor the mounting/unmounting of file systems. 7 Systemd – Units Continued ● Snapshots – save the state of units – useful for testing ● Timers – Timer-based activation ● Paths – Uses inotify to monitor a path ● Slices – For resource management. ● system.slice – services started by systemd ● user.slice – user processes ● machine.slice – VMs or containers registered with systemd 8 Systemd – Dependency Resolution ● Example: ● Wait for block device ● Check file system for device ● Mount file system ● nfs-lock.service: ● Requires=rpcbind.service network.target ● After=network.target named.service rpcbind.service ● Before=remote-fs-pre.target 9 That's all great .......but 10 Replace Init scripts!? Are you crazy?! 11 We're not crazy, I promise ● SysVinit had a good run, but leaves a lot to be desired.
    [Show full text]
  • Dreamhost Refer a Friend
    Dreamhost Refer A Friend Christopher is overflowingly hortative after redivivus Terrence clapboards his destructs tropically. Instructive Christos swigging inequitably. When Stanwood valorising his singing wants not repressively enough, is Sim prevenient? Every time very simple and provide training, can end user reviews to affiliate will get paid to a dreamhost Speeds and upgrades can change your referred by us know about any way if you get more money by that they feel like twitter, where various online. Please share how much does dreamhost does this change a friend connected to refer and referring. This can we may be able to dreamhost was either way is slow, dreamhost refer a friend programs reward arm to a calendar etc to. Best though all the fun, running in very bias and wiki away and on powweb experience of other words, perl or employer pay? Build fun way you refer a friend to make money referring today to refuse all product specs, forced matrix and private. Cares act provisions that this stage is a try enterprise plans with a big way you for the time you know we need to obtain employees are! Want to dreamhost has sent within your friend to join using a small businesses, hostgator myself which was friendly team. How these things like the. Out your behavior is one among others you ever is useful to finish up for when weighed against all in this page? But dreamhost been a friend and refer different portfolios. They refer friends to dreamhost server that speaks spanish. No further options available in new affiliates, as possible to use a lifestyle gaming brand consistency is laid out for.
    [Show full text]
  • Rubyperf.Pdf
    Ruby Performance. Tips, Tricks & Hacks Who am I? • Ezra Zygmuntowicz (zig-mun-tuv-itch) • Rubyist for 4 years • Engine Yard Founder and Architect • Blog: http://brainspl.at Ruby is Slow Ruby is Slow?!? Well, yes and no. The Ruby Performance Dichotomy Framework Code VS Application Code Benchmarking: The only way to really know performance characteristics Profiling: Measure don’t guess. ruby-prof What is all this good for in real life? Merb Merb Like most useful code it started as a hack, Merb == Mongrel + Erb • No cgi.rb !! • Clean room implementation of ActionPack • Thread Safe with configurable Mutex Locks • Rails compatible REST routing • No Magic( well less anyway ;) • Did I mention no cgi.rb? • Fast! On average 2-4 times faster than rails Design Goals • Small core framework for the VC in MVC • ORM agnostic, use ActiveRecord, Sequel, DataMapper or roll your own db access. • Prefer simple code over magic code • Keep the stack traces short( I’m looking at you alias_method_chain) • Thread safe, reentrant code Merb Hello World No code is faster then no code • Simplicity and clarity trumps magic every time. • When in doubt leave it out. • Core framework to stay small and simple and easy to extend without gross hacks • Prefer plugins for non core functionality • Plugins can be gems Key Differences • No auto-render. The return value of your controller actions is what gets returned to client • Merb’s render method just returns a string, allowing for multiple renders and more flexibility • PartController’s allow for encapsualted applets without big performance cost Why not work on Rails instead of making a new framework? • Originally I was trying to optimize Rails and make it more thread safe.
    [Show full text]
  • Next Generation Web Scanning Presentation
    Next generation web scanning New Zealand: A case study First presented at KIWICON III 2009 By Andrew Horton aka urbanadventurer NZ Web Recon Goal: To scan all of New Zealand's web-space to see what's there. Requirements: – Targets – Scanning – Analysis Sounds easy, right? urbanadventurer (Andrew Horton) www.morningstarsecurity.com Targets urbanadventurer (Andrew Horton) www.morningstarsecurity.com Targets What does 'NZ web-space' mean? It could mean: •Geographically within NZ regardless of the TLD •The .nz TLD hosted anywhere •All of the above For this scan it means, IPs geographically within NZ urbanadventurer (Andrew Horton) www.morningstarsecurity.com Finding Targets We need creative methods to find targets urbanadventurer (Andrew Horton) www.morningstarsecurity.com DNS Zone Transfer urbanadventurer (Andrew Horton) www.morningstarsecurity.com Find IP addresses on IRC and by resolving lots of NZ websites 58.*.*.* 60.*.*.* 65.*.*.* 91.*.*.* 110.*.*.* 111.*.*.* 113.*.*.* 114.*.*.* 115.*.*.* 116.*.*.* 117.*.*.* 118.*.*.* 119.*.*.* 120.*.*.* 121.*.*.* 122.*.*.* 123.*.*.* 124.*.*.* 125.*.*.* 130.*.*.* 131.*.*.* 132.*.*.* 138.*.*.* 139.*.*.* 143.*.*.* 144.*.*.* 146.*.*.* 150.*.*.* 153.*.*.* 156.*.*.* 161.*.*.* 162.*.*.* 163.*.*.* 165.*.*.* 166.*.*.* 167.*.*.* 192.*.*.* 198.*.*.* 202.*.*.* 203.*.*.* 210.*.*.* 218.*.*.* 219.*.*.* 222.*.*.* 729,580,500 IPs. More than we want to try. urbanadventurer (Andrew Horton) www.morningstarsecurity.com IP address blocks in the IANA IPv4 Address Space Registry Prefix Designation Date Whois Status [1] -----
    [Show full text]
  • Cisco Virtualized Infrastructure Manager Installation Guide, 2.4.9
    Cisco Virtualized Infrastructure Manager Installation Guide, 2.4.9 First Published: 2019-01-09 Last Modified: 2019-05-20 Americas Headquarters Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA http://www.cisco.com Tel: 408 526-4000 800 553-NETS (6387) Fax: 408 527-0883 THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS, INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS. THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY, CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY. The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California. NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS. CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
    [Show full text]
  • Contributed to Open Source in Ruby Community by Building Lazyload-Image-Rails Gem and Contribution to Rails
    Name: Sunkuru Abhishek Mobile: +91-9840515108 Email: [email protected] Git: https://github.com/abhisheksunkuru Skype: abhisheksunkuru Professional Summary Having Around 6 years of experience in building Web Applications Using RubyonRails. Experienced in technologies like Facebook Open graph. Good at relational databases MySql, PostgreSQL. Active team player, mentor and a self-starter, capable of working independently. Exposure to Software Development Life Cycle. Experienced in javascript libraries like Jquery,React Js. Experienced in Amazon services like Aws-s3,Cloudfront. Experienced in building REST API Experienced in Heroku and Capistrano deployment process. Knowledge in programming languages like Ruby,java. Contributed to open source in ruby community by building lazyload-image-rails gem and contribution to Rails. Utilized the Git and Svn Repository for our project to maintain the code versioning. Professional Experience Working as Senior Software Engineer in Tranway technologies from may 2018 to till date. Working as Senior Software Engineer in Nuware Systems LLP from Oct 2016 to Dec 2017. Working as Senior Software Engineer in Sedin Technologies Pvt Ltd from Dec 2013 to Oct 2016. Working as Software Engineer in Maisa Solutions Pvt Ltd,Hyderabad from June 2013 to November 2013. Worked as Software Engineer in Rising Sun Technologies Pvt Ltd., Jaipur from May 2012 to May 2013. Educational Qualifications B.Tech (IT) from Jawaharlal Nehru Technological University with 63.7%. Intermediate (M.P.C) from Sri Chaitanya Junior college with 90.1 %. S.S.C from Zilla Parishad High School with 85.3 %. Technical Skills Languages : Ruby. Web Technologies : HTML, XML, CSS , JAVASCRIPT, Jquery, Haml, ReactJs. Application Server : Thin, Webrick,puma.
    [Show full text]
  • Questions for Mongrel
    www.YoYoBrain.com - Accelerators for Memory and Learning Questions for Mongrel Category: Introduction - (16 questions) Mongrel is described in what way in the "A web application container for Ruby on Mongrel pdf available from O Reilly Rails" Mongrel is compared with what web servers production performance: Fast CGI or SCGI in the Rails world in terms of production performance and development Development: WEBrick simplicity/speed Creator of Mongrel Zed A Shawwww.zedshaw.com Mongrel is developed on what mixture of Ruby and C programming/scripting languages Documentation for Mongrel mongrel.rubyforge.org/docs/index.html The creators of Mongrel describe it how? a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI. It is framework agnostic Three key technologies that are used for A custom HTTP 1.1 parser (based on RFC Mongrel's internals standard, written using Ragel in C and Java as a Rby extension) Simple server that uses the parser and URIClassifier to process requests, find the right handlers, then pass the results to the handler for processing Handlers are responsible for using HttpRequet and HttpResponse objects to "do their thing and then return results" Component of Mongrel responsible for Handlers dealing with HttpRequest and HttpResponse How does Mongrel support threading one thread per request, but it will start closing connections when it gets "overloaded"while Mongrel is processing HTTP requests and sending responses it uses Ruby's threading system What platforms that already work with Camping and Og+Nitro Mongrel are throught to be "thread-safe" Have not been heavily tested Is Ruby on Rails thread safe? no How does Mongrel handle Rails" " Ruby on Rails is not thread safe so there is a synchronized block around the calls to Dispatcher.dispatch.
    [Show full text]
  • Ruby on Rails Matt Dees All Trademarks Used Herein Are the Sole Property of Their Respective Owners
    Ruby on Rails Matt Dees All trademarks used herein are the sole property of their respective owners. Introduction How Ruby on Rails Works cPanel's interaction with Ruby on Rails Administrating Ruby on Rails Troubleshooting Ruby on Rails What is Ruby on Rails? A Web Application Framework aimed towards the rapid development and deployment of Dynamic Web 2.0 Applications Interpreted Programming Language Web Applications are done through either Rails or as a straight CGI application Every part of the Ruby on Rails system is dependent on ruby working correctly Gems Gems are Ruby modules Either compiled or interpreted Ruby code Gems can be full applications or libraries for Ruby programs Managed by the “gem” command Rails Rails is a framework for creating Ruby applications and provides several different pieces of functionality Rails exists for multiple programming languages Is a gem Consists of several gems used for handling different functions Different versions of this exist, each application requires a specific version Rails Continued Action Record – Rapid development library for building daemon independent database queries Action Pack – An implementation of Model View Controller for Ruby. Action Mailer – An Email Handler Webserver – Usually webrick, however we use mongrel Mongrel Mongrel is the Web Server used for serving Ruby on Rails applications One instance per Ruby application Other daemons exist, but mongrel has the best security and performance record Is a gem Runs applications on port 12001 and up on cPanel Uses a significant amount
    [Show full text]
  • Comodo Antispam Gateway Software Version 1.5
    Comodo Antispam Gateway Software Version 1.5 Administrator Guide Guide Version 1.5.082412 Comodo Security Solutions 525 Washington Blvd. Jersey City, NJ 07310 Comodo Antispam Gateway - Administrator Guide Table of Contents 1 Introduction to Comodo Antispam Gateway........................................................................................................................... 4 1.1 Release Notes............................................................................................................................................................. 5 1.2 Purchasing License .................................................................................................................................................... 6 1.3 Adding more Users, Domains or Time to your Account .................................................................................................6 1.4 License Information................................................................................................................................................... 10 2 Getting Started................................................................................................................................................................... 13 2.1 Incoming Filtering Configuration ................................................................................................................................ 13 2.1.1 Configuring Your Mail Server..................................................................................................................................
    [Show full text]