{"id":346,"date":"2011-01-27T17:33:46","date_gmt":"2011-01-27T22:33:46","guid":{"rendered":"http:\/\/www.1oc.com\/blog\/?p=346"},"modified":"2011-07-14T22:21:19","modified_gmt":"2011-07-15T02:21:19","slug":"installing-phusions-passenger-on-centos-for-ruby-1-9","status":"publish","type":"post","link":"http:\/\/blog.1oc.com\/?p=346","title":{"rendered":"Installing Phusion&#8217;s Passenger on CentOS (for Ruby 1.9)"},"content":{"rendered":"<p>As a prerequisite you have to have installed Ruby 1.9.x on your CentOS system.<\/p>\n<p>If you don&#8217;t know how to do it, follow the instructions on this post:<\/p>\n<h2><a title=\"Permalink to Installing Ruby 1.9 on CentOS\" href=\"http:\/\/blog.1oc.com\/?p=336\" rel=\"bookmark\">Installing Ruby 1.9 on CentOS<\/a><\/h2>\n<p>Once you are ready follow the next steps:<\/p>\n<p>On a terminal type:<\/p>\n<p>$\u00a0<span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">gem install passenger<\/span><\/p>\n<p><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">$ <\/span><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">passenger-install-apache2-module<\/span><\/p>\n<p><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">This last command is going to walk you through the process of installation,<\/span><\/p>\n<p><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">helping you install whatever is missing on your system and at the end giving the instructions <\/span><\/p>\n<p><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">to &#8220;patch&#8221; your apache&#8217;s configurations file.<\/span><\/p>\n<p><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\"><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.12.35-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-356 alignnone\" title=\"Screen shot 2011-01-27 at 5.12.35 PM\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.12.35-PM-300x197.png\" alt=\"passenger-install-appache2-module\" width=\"300\" height=\"197\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.12.35-PM-300x197.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.12.35-PM-455x300.png 455w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.12.35-PM.png 676w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<\/span><\/p>\n<p><span style=\"font-family: monospace; line-height: 18px; font-size: 12px; white-space: pre;\">On my case, I had to install the following modules:<\/span><\/p>\n<p>$ yum install httpd-devel<\/p>\n<p>$ yum install apr-devel<\/p>\n<p>$ yum install apr-util-devel<\/p>\n<p><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.13.19-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-357 alignnone\" title=\"Screen shot 2011-01-27 at 5.13.19 PM\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.13.19-PM-300x198.png\" alt=\"\" width=\"300\" height=\"198\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.13.19-PM-300x198.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.13.19-PM-453x300.png 453w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.13.19-PM.png 674w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>After installing them re-run the command again<\/p>\n<p><em>$ passenger-install-apache2-module<\/em><\/p>\n<p>And then edit the apache configuration<\/p>\n<p>\/etc\/httpd\/conf\/httpd.conf<\/p>\n<p>Ad the following lines to the file:<\/p>\n<div id=\"_mcePaste\">LoadModule passenger_module \/usr\/local\/lib\/ruby\/gems\/1.9.1\/gems\/passenger-3.0.2\/ext\/apache2\/mod_passenger.so<\/div>\n<div id=\"_mcePaste\">PassengerRoot \/usr\/local\/lib\/ruby\/gems\/1.9.1\/gems\/passenger-3.0.2<\/div>\n<div id=\"_mcePaste\">PassengerRuby \/usr\/local\/bin\/ruby<\/div>\n<div>And finally configure your VirtualDirectories (on the same file)<\/div>\n<div>\n<div style=\"padding-left: 30px;\"><em>&lt;VirtualHost *:80&gt;<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>ServerName ruby.1oc.com<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>DocumentRoot &#8220;\/var\/www\/virtualhost\/ruby.1oc.com\/web\/public&#8221;<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>&lt;Directory &#8220;\/var\/www\/virtualhost\/ruby.1oc.com\/web\/public&#8221;&gt;<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>AllowOverride all<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>Options -MultiViews<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>&lt;\/Directory&gt;<\/em><\/div>\n<div style=\"padding-left: 30px;\"><em>&lt;\/VirtualHost&gt;<\/em><\/div>\n<\/div>\n<div>Now reboot the apache server<\/div>\n<div>$\u00a0\/etc\/init.d\/httpd restart<\/div>\n<div>\n<div style=\"padding-left: 30px;\">Stopping httpd: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0[ \u00a0OK \u00a0]<\/div>\n<div style=\"padding-left: 30px;\">Starting httpd: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0[ \u00a0OK \u00a0]<\/div>\n<div>Now you are ready to go.<\/div>\n<div>Test the site\u00a0http:\/\/ruby.1oc.com\/<\/div>\n<div><a href=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.32.51-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-363 alignleft\" title=\"Screen shot 2011-01-27 at 5.32.51 PM\" src=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.32.51-PM-300x286.png\" alt=\"ruby.1oc.com\" width=\"300\" height=\"286\" srcset=\"http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.32.51-PM-300x286.png 300w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.32.51-PM-1024x979.png 1024w, http:\/\/blog.1oc.com\/wp-content\/uploads\/2011\/01\/Screen-shot-2011-01-27-at-5.32.51-PM.png 1033w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>As a prerequisite you have to have installed Ruby 1.9.x on your CentOS system. If you don&#8217;t know how to do it, follow the instructions on this post: Installing Ruby 1.9 on CentOS Once you are ready follow the next &hellip; <a href=\"http:\/\/blog.1oc.com\/?p=346\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8,9],"tags":[],"class_list":["post-346","post","type-post","status-publish","format-standard","hentry","category-genexus","category-servers","category-unix"],"_links":{"self":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts\/346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=346"}],"version-history":[{"count":1,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts\/346\/revisions"}],"predecessor-version":[{"id":402,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=\/wp\/v2\/posts\/346\/revisions\/402"}],"wp:attachment":[{"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.1oc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}