SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
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 of memory
cPanel and Ruby on Rails
cPanel provides an interface for managing Ruby on
  Rails applications inside of each user's cPanel

   Can be enabled/disabled via the feature manager in
  WHM
   Number of Ruby applications a user is allowed can
  be modified via “Modify an Account” in WHM with the
  “Max Mongrels” option
   This number should be limited as ruby uses it's own
  webserver for each application that uses memory
The WHM/cPanel Interface
What cPanel Does with RoR


 When cPanel creates this application, it runs
 “rails /path/to/application”
 The information for the application is stored in
 ~/.cpanel/ruby-on-rails.db
  A mongrel process is executed when “run” is hit
 each user has their own set of ruby binaries, libraries
 and gems in ~/ruby/
Rails and the Shell

Ruby on Rails is designed for each application to be
  administered from the shell

   Nearly all applications assume shell access to the
  hosting server
  The Rakefile is used to deploy rails application, this
  will automatically setup databases and many other
  portions of an application, this is accessed using the
  “rake” command
How Apache Interacts with RoR
Apache interacts with Ruby on Rails by settings up
  Rewrites

  Uses mod_rewrite in ~/public_html/.htaccess
  stored in ~/.cpanel/ruby-on-rails-
  rewrites.db
   You can only redirect the main domain, subdomain
  or addon domain to a ruby on rails application.
Rewrite Interface
Rewrite Creation Interface
cPanel and Gems

There are three methods of installing gems on a cPanel
  system, either via WHM, cPanel or the CLI

   The CLI is the recommended method
  When installed through cPanel, they are installed to
  ~/ruby/gems
  When installed through WHM or the CLI they are
  installed globally to /usr/lib/ruby
cPanel Gem Interface
gem CLI

The gem CLI allows you to install, troubleshoot and
  perform maintenance on Ruby modules

   Similar to cpan and pear
   Gems are installed to /usr/lib/ruby/gems/1.8/gems
  For users, they need to run either /scripts/
  gemwrapper or ~/ruby/bin/gem
gem CLI (cont.)‫‏‬

gem list
  This will list all of the gems currently installed on
 your server


gem list --remote
  will list all gems available from http://
 gems.rubyforge.org/
gem CLI (cont.)‫‏‬
gem install <gemname>
  Installs a gem
  Can be specified with -v for a specific version of a
 gem (such as rails)
  useful for testing errors with our gem installation
 method
gem CLI (cont.)‫‏‬

gem check –specification <gemname>
  This will allow you to see what files a module will
 install, what dependencies it has and general
 information on the gem

gem check –alien <gemname>
  Security check, will check for any abnormal files
 inside of the module's base
gem check –verify <filename>
  Checks the MD5sum of a file from a module versus
 the repository
gems without the gem command

Ruby modules can be downloaded from http://
  gem.rubyforge.org. This allows gems to be installed
  even if the gem CLI is not working

You will need to untar the package, chdir into the
  directory, then run “ruby setup.rb”
Logs For Application Startup
Issues
/usr/local/cpanel/logs/error_log
  This will show any issues with executing the mongrel
 process itself


<APPBASE>/log/mongrel.log
  This will show any issues with mongrel failing to load
 gems, 90% of failed starts will be contained here
Logs For Application Errors

<APPBASE>/log/(production|
  development).log
  These logs will show any errors that the application
 has while executing.
  If your user is complaining about an application
 acting funny, it will probably be here
  most issues inside of these logs indicate application
 side errors that cannot be fixed at the server level.
Application Startup Issues

The best way to check application startup issues is to
  execute the application manually with the following
  command:
chdir <APPBASE> && sudo -u <USERNAME> /
  usr/bin/ruby /usr/bin/mongrel_rails
  start -p <port> -d -e production -P
  log/mongrel.pid
   This will execute the mongrel instance on it's own,
  outside of cPanel making process tracing simple
Gem Installation Issues
Our gem installer is executed via /scripts/gemwrapper,
  which initializes some environment variables into gem
  that make it work with our homedir setup. We also
  use a cache file located at:
 ~/.cpanel/datastore/
  _scripts_gemwrapper_--noexpect_list_--
  remote
to store a list of these gems, if this file exists but does
   not contain a list of gems, remove it and refresh the
   page
Gem Installation Issues (cont)‫‏‬

There are a few other things that should be checked for
  gem installation errors

   Does the user have compiler access?
  Can the user write to their own ~/ruby/ directory?
   User Quota?
Question
   &
Answer

Weitere ähnliche Inhalte

Was ist angesagt?

Laravel presentation
Laravel presentationLaravel presentation
Laravel presentationToufiq Mahmud
 
How to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialHow to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialKaty Slemon
 
Getting to know Laravel 5
Getting to know Laravel 5Getting to know Laravel 5
Getting to know Laravel 5Bukhori Aqid
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingChristopher Pecoraro
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configurationDima Gomaa
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
How to install laravel framework in windows
How to install laravel framework in windowsHow to install laravel framework in windows
How to install laravel framework in windowsSabina Sadykova
 
Building dynamic websites with Mod perl and apache
Building dynamic websites with Mod perl and apacheBuilding dynamic websites with Mod perl and apache
Building dynamic websites with Mod perl and apacheKamal Nayan
 
Developing SOAP Web Services using Java
Developing SOAP Web Services using JavaDeveloping SOAP Web Services using Java
Developing SOAP Web Services using Javakrishnaviswambharan
 
Automated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.orgAutomated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.orgFrancis Luong
 
Integrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On WindowsIntegrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On WindowsMohanraj Nagasamy
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
Introduction to Servlets
Introduction to ServletsIntroduction to Servlets
Introduction to ServletsFulvio Corno
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer packageLattapon Yodsuwan
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEJacek Laskowski
 
Sitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelinesSitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelinesBenjamin Vangansewinkel
 

Was ist angesagt? (20)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
 
How to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialHow to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorial
 
Getting to know Laravel 5
Getting to know Laravel 5Getting to know Laravel 5
Getting to know Laravel 5
 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routing
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
How to install laravel framework in windows
How to install laravel framework in windowsHow to install laravel framework in windows
How to install laravel framework in windows
 
Building dynamic websites with Mod perl and apache
Building dynamic websites with Mod perl and apacheBuilding dynamic websites with Mod perl and apache
Building dynamic websites with Mod perl and apache
 
Developing SOAP Web Services using Java
Developing SOAP Web Services using JavaDeveloping SOAP Web Services using Java
Developing SOAP Web Services using Java
 
Automated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.orgAutomated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.org
 
Integrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On WindowsIntegrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On Windows
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Introduction to Servlets
Introduction to ServletsIntroduction to Servlets
Introduction to Servlets
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer package
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
 
Introduction Apache solr 4.4
Introduction Apache solr 4.4Introduction Apache solr 4.4
Introduction Apache solr 4.4
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 
Sitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelinesSitecore - Deep drive into the Sitecore Client pipelines
Sitecore - Deep drive into the Sitecore Client pipelines
 

Andere mochten auch

Seminário de Sistemas Distribuídos - Blue Cloud
Seminário de Sistemas Distribuídos - Blue CloudSeminário de Sistemas Distribuídos - Blue Cloud
Seminário de Sistemas Distribuídos - Blue CloudWeldys Santos
 
Inovale - Produtividade
Inovale - ProdutividadeInovale - Produtividade
Inovale - ProdutividadeCreative Pack
 
Inovale - Sustentabilidade
Inovale - SustentabilidadeInovale - Sustentabilidade
Inovale - SustentabilidadeCreative Pack
 
Inovale - Transporte Coletivo e Veículos Leves
Inovale - Transporte Coletivo e Veículos LevesInovale - Transporte Coletivo e Veículos Leves
Inovale - Transporte Coletivo e Veículos LevesCreative Pack
 
Inovale - Educação
Inovale - EducaçãoInovale - Educação
Inovale - EducaçãoCreative Pack
 
Inovale - Processo Operacional
Inovale - Processo OperacionalInovale - Processo Operacional
Inovale - Processo OperacionalCreative Pack
 
Inovale - Gestão de Informação
Inovale - Gestão de InformaçãoInovale - Gestão de Informação
Inovale - Gestão de InformaçãoCreative Pack
 
Inovale - Desperdício
Inovale - DesperdícioInovale - Desperdício
Inovale - DesperdícioCreative Pack
 

Andere mochten auch (9)

Seminário de Sistemas Distribuídos - Blue Cloud
Seminário de Sistemas Distribuídos - Blue CloudSeminário de Sistemas Distribuídos - Blue Cloud
Seminário de Sistemas Distribuídos - Blue Cloud
 
Inovale - Produtividade
Inovale - ProdutividadeInovale - Produtividade
Inovale - Produtividade
 
Inovale - Sustentabilidade
Inovale - SustentabilidadeInovale - Sustentabilidade
Inovale - Sustentabilidade
 
Inovale - Transporte Coletivo e Veículos Leves
Inovale - Transporte Coletivo e Veículos LevesInovale - Transporte Coletivo e Veículos Leves
Inovale - Transporte Coletivo e Veículos Leves
 
Inovale - Educação
Inovale - EducaçãoInovale - Educação
Inovale - Educação
 
Inovale - Processo Operacional
Inovale - Processo OperacionalInovale - Processo Operacional
Inovale - Processo Operacional
 
Inovale - Gestão de Informação
Inovale - Gestão de InformaçãoInovale - Gestão de Informação
Inovale - Gestão de Informação
 
Inovale - Saúde
Inovale - SaúdeInovale - Saúde
Inovale - Saúde
 
Inovale - Desperdício
Inovale - DesperdícioInovale - Desperdício
Inovale - Desperdício
 

Ähnlich wie Rails onCpanel

Instruments ruby on rails
Instruments ruby on railsInstruments ruby on rails
Instruments ruby on railspmashchak
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsanides
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystemGeison Goes
 
Introduction To Rails
Introduction To RailsIntroduction To Rails
Introduction To RailsEric Gruber
 
All girlhacknight intro to rails
All girlhacknight intro to railsAll girlhacknight intro to rails
All girlhacknight intro to railsNola Stowe
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction Tran Hung
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & CucumberUdaya Kiran
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3Blazing Cloud
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Maurício Linhares
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The EnterpriseMatt Aimonetti
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorialsunniboy
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxSaziaRahman
 
Rails engines in large apps
Rails engines in large appsRails engines in large apps
Rails engines in large appsEnrico Teotti
 

Ähnlich wie Rails onCpanel (20)

Instruments ruby on rails
Instruments ruby on railsInstruments ruby on rails
Instruments ruby on rails
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
 
Introduction To Rails
Introduction To RailsIntroduction To Rails
Introduction To Rails
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
All girlhacknight intro to rails
All girlhacknight intro to railsAll girlhacknight intro to rails
All girlhacknight intro to rails
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
 
grate techniques
grate techniquesgrate techniques
grate techniques
 
An introduction to Rails 3
An introduction to Rails 3An introduction to Rails 3
An introduction to Rails 3
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
TorqueBox
TorqueBoxTorqueBox
TorqueBox
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
 
Rails engines in large apps
Rails engines in large appsRails engines in large apps
Rails engines in large apps
 
Rails engine
Rails engineRails engine
Rails engine
 

Kürzlich hochgeladen

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Kürzlich hochgeladen (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

Rails onCpanel

  • 1. Ruby on Rails Matt Dees
  • 2. All trademarks used herein are the sole property of their respective owners.
  • 3. Introduction How Ruby on Rails Works cPanel's interaction with Ruby on Rails Administrating Ruby on Rails Troubleshooting Ruby on Rails
  • 4. What is Ruby on Rails? A Web Application Framework aimed towards the rapid development and deployment of Dynamic Web 2.0 Applications
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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 of memory
  • 10. cPanel and Ruby on Rails cPanel provides an interface for managing Ruby on Rails applications inside of each user's cPanel Can be enabled/disabled via the feature manager in WHM Number of Ruby applications a user is allowed can be modified via “Modify an Account” in WHM with the “Max Mongrels” option This number should be limited as ruby uses it's own webserver for each application that uses memory
  • 12. What cPanel Does with RoR When cPanel creates this application, it runs “rails /path/to/application” The information for the application is stored in ~/.cpanel/ruby-on-rails.db A mongrel process is executed when “run” is hit each user has their own set of ruby binaries, libraries and gems in ~/ruby/
  • 13. Rails and the Shell Ruby on Rails is designed for each application to be administered from the shell Nearly all applications assume shell access to the hosting server The Rakefile is used to deploy rails application, this will automatically setup databases and many other portions of an application, this is accessed using the “rake” command
  • 14. How Apache Interacts with RoR Apache interacts with Ruby on Rails by settings up Rewrites Uses mod_rewrite in ~/public_html/.htaccess stored in ~/.cpanel/ruby-on-rails- rewrites.db You can only redirect the main domain, subdomain or addon domain to a ruby on rails application.
  • 17. cPanel and Gems There are three methods of installing gems on a cPanel system, either via WHM, cPanel or the CLI The CLI is the recommended method When installed through cPanel, they are installed to ~/ruby/gems When installed through WHM or the CLI they are installed globally to /usr/lib/ruby
  • 19. gem CLI The gem CLI allows you to install, troubleshoot and perform maintenance on Ruby modules Similar to cpan and pear Gems are installed to /usr/lib/ruby/gems/1.8/gems For users, they need to run either /scripts/ gemwrapper or ~/ruby/bin/gem
  • 20. gem CLI (cont.)‫‏‬ gem list This will list all of the gems currently installed on your server gem list --remote will list all gems available from http:// gems.rubyforge.org/
  • 21. gem CLI (cont.)‫‏‬ gem install <gemname> Installs a gem Can be specified with -v for a specific version of a gem (such as rails) useful for testing errors with our gem installation method
  • 22. gem CLI (cont.)‫‏‬ gem check –specification <gemname> This will allow you to see what files a module will install, what dependencies it has and general information on the gem gem check –alien <gemname> Security check, will check for any abnormal files inside of the module's base gem check –verify <filename> Checks the MD5sum of a file from a module versus the repository
  • 23. gems without the gem command Ruby modules can be downloaded from http:// gem.rubyforge.org. This allows gems to be installed even if the gem CLI is not working You will need to untar the package, chdir into the directory, then run “ruby setup.rb”
  • 24. Logs For Application Startup Issues /usr/local/cpanel/logs/error_log This will show any issues with executing the mongrel process itself <APPBASE>/log/mongrel.log This will show any issues with mongrel failing to load gems, 90% of failed starts will be contained here
  • 25. Logs For Application Errors <APPBASE>/log/(production| development).log These logs will show any errors that the application has while executing. If your user is complaining about an application acting funny, it will probably be here most issues inside of these logs indicate application side errors that cannot be fixed at the server level.
  • 26. Application Startup Issues The best way to check application startup issues is to execute the application manually with the following command: chdir <APPBASE> && sudo -u <USERNAME> / usr/bin/ruby /usr/bin/mongrel_rails start -p <port> -d -e production -P log/mongrel.pid This will execute the mongrel instance on it's own, outside of cPanel making process tracing simple
  • 27. Gem Installation Issues Our gem installer is executed via /scripts/gemwrapper, which initializes some environment variables into gem that make it work with our homedir setup. We also use a cache file located at: ~/.cpanel/datastore/ _scripts_gemwrapper_--noexpect_list_-- remote to store a list of these gems, if this file exists but does not contain a list of gems, remove it and refresh the page
  • 28. Gem Installation Issues (cont)‫‏‬ There are a few other things that should be checked for gem installation errors Does the user have compiler access? Can the user write to their own ~/ruby/ directory? User Quota?
  • 29. Question & Answer