{"id":568,"date":"2021-07-05T08:07:07","date_gmt":"2021-07-05T13:07:07","guid":{"rendered":"https:\/\/www.knownhost.com\/kb\/?p=568"},"modified":"2026-01-23T06:33:36","modified_gmt":"2026-01-23T12:33:36","slug":"installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/","title":{"rendered":"Installing Ruby on Rails Apps on a cPanel\/CentOS 7 Server with EasyApache 4"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #212121;color:#212121\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #212121;color:#212121\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#quick_start_for_ruby_on_rails_installation_guide\" >Quick Start for Ruby on Rails Installation Guide<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#a_simple_ruby_on_rails_script\" >A Simple Ruby on Rails Script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#extended_installation_instructions_with_screenshots\" >Extended Installation Instructions with Screenshots<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#special_considerations\" >Special Considerations<\/a><\/li><\/ul><\/nav><\/div>\n<div class=\"kb-shortcode kb-shortcode_warning\">\n                    <div class=\"kb-shortcode-icon\">\n                        <i class=\"fa fa-exclamation-triangle fa-2x\"><\/i>\n                    <\/div>\n                    <div class=\"kb-shortcode-content_warning\">This is an informational guide in which its intended use is for experienced systems administrators.<\/p>\n<p>Should you contact support regarding this article; KnownHost will only be able to assist with the initial installation of ruby and\/or ruby passenger packages.<\/div>\n                <\/div>\n\n\n\n<p>cPanel deprecated Ruby on Rails in cPanel &amp; WHM version 66 since it is not supported on CentOS 7 servers. Rails is a Ruby application, and they support Ruby applications via cPanel&#8217;s Application Manager interface (Home \u00bb Software \u00bb Application Manager), so this can&nbsp;<em>technically<\/em>&nbsp;be done. However, I cannot promise that it will run seamlessly forever since cPanel&#8217;s Ruby implementation has changed quite frequently in the past.<\/p>\n\n\n\n<p>Let&#8217;s install Rails.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"quick_start_for_ruby_on_rails_installation_guide\"><\/span>Quick Start for Ruby on Rails Installation Guide<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For those of you who prefer a quick-start and are comfortable running commands as&nbsp;<em>root<\/em>&nbsp;via SSH, see below.<\/p>\n\n\n\n<p>As the user&nbsp;<em>root<\/em>&nbsp;via SSH (remember that <a href=\"https:\/\/www.knownhost.com\/\">KnownHost<\/a> uses port 2200 by default for SSH), run the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  yum -y install ea-ruby24-mod_passenger ea-ruby24-ruby-devel ImageMagick-devel sqlite-devel ea-apache24-mod_env ea-ruby24-rubygem-passenger ea-ruby24-rubygem-rack ea-ruby24-rubygem-rake ea-ruby24-rubygem-sqlite3\n  curl --silent --location https:\/\/rpm.nodesource.com\/setup_8.x | bash -\n  yum -y install nodejs\n  scl enable ea-ruby24 'gem install bundler bundle spring uglifier turbolinks rails'<\/code><\/pre>\n\n\n\n<p><em><strong>Note<\/strong>:<\/em>&nbsp;We must install NodeJS separately above because it isn&#8217;t available by default in the CentOS\/cPanel yum repos.<\/p>\n\n\n<div class=\"kb-shortcode kb-shortcode_tip\">\n                    <div class=\"kb-shortcode-icon\">\n                        <i class=\"fa fa-lightbulb-o fa-2x\"><\/i>\n                    <\/div>\n                    <div class=\"kb-shortcode-content_tip\">NodeJS is available via the EasyApache 4 repo as of WHM 78.<\/div>\n                <\/div>\n\n\n\n<p>Next, you will need a cPanel user to own the <a href=\"https:\/\/rubyonrails.org\/\">Rails application<\/a>. If you have yet to create a cPanel account for this, you can use the following commands as the&nbsp;<em>root<\/em>&nbsp;user to create a new user, replacing the appropriate fields as desired (domain, user, password, etc). Then, modify the user to be permitted to have Passenger Apps. The last command creates the Passenger App via cPanel&#8217;s Application Manager (be sure to edit appropriately for the app you want to create):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  whmapi1 createacct username=mycpuser domain=mycpdomain.tld hasshell=1\n  whmapi1 modifyacct user=mycpuser MAXPASSENGERAPPS=5\n  uapi --user=mycpuser PassengerApps register_application name=\"test_blog\" path=\"\/ruby_apps\/test_blog\" domain=\"mycpdomain.tld\" deployment_mode=\"development\" enabled=\"1\"<\/code><\/pre>\n\n\n\n<p><em><strong>Note<\/strong><\/em>: I am using&nbsp;<em>mode=&#8221;development&#8221;<\/em>&nbsp;because I will be creating my Rails App from scratch. You would use&nbsp;<em>mode=&#8221;production&#8221;<\/em>&nbsp;if you were migrating an existing production Ruby on Rails application.<\/p>\n\n\n\n<p>You will also need to enable compilers for the user.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  usermod -a -G compiler mycpuser    # replace mycpuser with your cPanel username<\/code><\/pre>\n\n\n\n<p>The first command below is the command that you will use to change to the cPanel user, but make sure to replace&nbsp;<em>mycpuser<\/em>&nbsp;with your actual cPanel user that will own the Ruby Application. Run the following commands in order to create a new test application called &#8220;test_blog&#8221; in the directory ~\/ruby_apps\/test_blog\/ (feel free to change these directories as desired, but make sure to use consistent data for the commands you issue).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  su mycpuser\n  cd ~\n  mkdir ruby_apps\n  cd ruby_apps\n  echo 'export PATH=$PATH:\/opt\/cpanel\/ea-ruby24\/root\/usr\/bin\/' &gt;&gt; ~\/.bashrc\n  echo 'export PATH=$PATH:\/opt\/cpanel\/ea-ruby24\/root\/usr\/local\/bin\/' &gt;&gt; ~\/.bashrc \n  source ~\/.bashrc\n  rails new test_blog\n  cd test_blog\n  bundle install --path vendor\/bundle<\/code><\/pre>\n\n\n\n<p>Note the location that we are installing the gems in the last command (vendor\/bundle). We are doing this so that this works with jailed shell.<\/p>\n\n\n\n<p>Now, you should be able to visit the domain in the browser and load the default Ruby on Rails page. From here, you can confirm that your Ruby and RoR implementations are working and proceed to build your Rails application!\u00a0<\/p>\n\n\n<div class=\"kb-shortcode kb-shortcode_warning\">\n                    <div class=\"kb-shortcode-icon\">\n                        <i class=\"fa fa-exclamation-triangle fa-2x\"><\/i>\n                    <\/div>\n                    <div class=\"kb-shortcode-content_warning\">Ruby application port numbers increment automatically with every new application. If you are on a shared server, the system assigns the next available port number to your application.<\/p>\n<p>Your first application will not necessarily run on port 12001.<\/div>\n                <\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"a_simple_ruby_on_rails_script\"><\/span>A Simple Ruby on Rails Script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The purpose of this script is to install all necessary software and set up a development Ruby on Rails Application for a cPanel user\/account. You have the option to create a new cPanel account within this script or to use an existing cPanel user. If you choose to use an existing cPanel user, the script assumes that the domain you enter also exists already. If the domain you want to use does not yet exist, then you will need to create it in the panel&nbsp;<em>before<\/em>&nbsp;executing this script. If this script completes successfully, you should be able to visit the domain in the browser (provided you&#8217;ve set up your&nbsp;DNS) and load the default &#8220;Yay! You\u2019re on Rails!&#8221; page. If an error occurs, the script *should* terminate immediately and inform you of the error, at which time, you will need to correct the error and proceed manually where the script left off with the &#8220;Quick Start&#8221; instructions above. This script has been tested with a default cPanel\/CentOS 7 Knownhost server. No guarantee is given that it will continue to work with future versions of CentOS\/cPanel. This script is provided only as a courtesy and without support.<\/p>\n\n\n\n<p>You will need to run this script as the root user after you&#8217;ve placed it on your server. Location does not matter, but you will want to remember to remove the script once done. The script will prompt you to enter certain information required to create\/assign the user with a directory to contain Ruby Applications, which will contain a fresh development of Ruby on Rails application that will load from the specified domain.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash -e\n \n#Confirm that the server is using EA4.\n \nif &#091; -f \/etc\/cpanel\/ea4\/is_ea4 ]; then\n  echo \"This is an EasyApache 4 Server. Proceeding...\"\nelse\n  echo \"This doesn't not appear to be an EasyApache 4 Server! Exiting due to incompatibility.\"\n  exit 1\nfi\n \n#Gather information needed for New cPanel user creation and Rails Application Creation\n \necho \"Will you be installing Rails for an existing cPanel user (Y\/N)? If you answer 'N', then the cPanel username you enter in the next step will be created as a new user\"\nread input\necho \"Enter cPanel username:\"\nread mycpuser\necho \"Enter the new cPanel user's domain that you want to load the Rails Application from:\"\nread domain\necho \"Enter the directory beneath the user's root directory in which to store Ruby Apps for this user (ex. Entering 'myrubyapps' will result in this directory from which your Rails app will be created: \/home\/cpanel_user\/myrubyapps\/):\"\nread ruby_apps_dir\necho \"Enter the name of your Rails Application (ex. myRailsBlog  This will create a Rails application with 'rails new myRailsBlog' command, which will be stored here: \/home\/cpanel_user\/myrubyapps\/myRailsBlog\/):\"\nread app_name\n \n#Create new user if necessary. Run some checks against user input. May want to also check in \/var\/cpanel\/users in case userdomains is outdated.\n \nif &#091; $input == 'y' ] || &#091; $input == 'Y' ]; then\n  grep -q \" ${mycpuser}$\" \/etc\/userdomains\n  if &#091; $? == 0 ]; then\n    echo \"Using existing user $mycpuser\"\n  else\n    echo \"User not found. Is the username misspelled?\"\n    exit 1\n  fi\nelif &#091; $input == 'n' ] || &#091; $input == 'N' ]; then\n  grep -q \" ${mycpuser}$\" \/etc\/userdomains\n  if &#091; $? != 0 ]; then\n    whmapi1 createacct username=$mycpuser domain=$domain hasshell=1\n  else\n    echo \"You elected to create a new account, however this user already exists. Exiting script.\"\n    exit 1\n  fi\nelse\n  echo \"Invalid input. Please try again.\"\n  exit 1\nfi\n \n# Install Ruby, Rails, NodeJS, and other necessary RPMs. \n \nyum -y install ea-ruby24-mod_passenger ea-ruby24-ruby-devel ImageMagick-devel sqlite-devel ea-apache24-mod_env ea-ruby24-rubygem-passenger ea-ruby24-rubygem-rack ea-ruby24-rubygem-rake ea-ruby24-rubygem-sqlite3\ncurl --silent --location https:\/\/rpm.nodesource.com\/setup_8.x | bash -\nyum -y install nodejs\nscl enable ea-ruby24 'gem install bundler bundle spring uglifier turbolinks rails'\n \n#Edit the user to ensure that they have access to PassengerApps, create the Passenger Application, and enable compiler access for the user. \n \nwhmapi1 modifyacct user=$mycpuser MAXPASSENGERAPPS=5\nuapi --user=$mycpuser PassengerApps register_application name=$app_name path=\"\/$ruby_apps_dir\/$app_name\" domain=\"$domain\" deployment_mode=\"development\" enabled=\"1\"\nusermod -a -G compiler $mycpuser\n \n# Execute commands as the user.  Make the Ruby Apps directory, change into it, edit the user's path for Ruby and Rails, and create the new Rails application. \n \nsu $mycpuser -s \/bin\/bash -c bash &lt;&lt; EOF\ncd ~\nmkdir $ruby_apps_dir\ncd $ruby_apps_dir\necho 'export PATH=$PATH:\/opt\/cpanel\/ea-ruby24\/root\/usr\/bin\/' &gt;&gt; ~\/.bashrc\necho 'export PATH=$PATH:\/opt\/cpanel\/ea-ruby24\/root\/usr\/local\/bin\/' &gt;&gt; ~\/.bashrc \nsource ~\/.bashrc\nrails new $app_name\ncd $app_name\nbundle install --path vendor\/bundle\nEOF<\/code><\/pre>\n\n\n\n<p>Save this script is&nbsp;<em>railsInstaller.sh<\/em>. Then, you will be able to run it as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  sh railsInstaller.sh<\/code><\/pre>\n\n\n\n<p>If you prefer, you could save it, make it executable, and then run it as shown below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  chmod +x railsInstaller.sh\n  .\/railsInstaller.sh<\/code><\/pre>\n\n\n\n<p>Feel free to edit the script to suit your needs. If you get any errors with the script claiming that a user does not exist after selecting to use an existing user, though you are certain that the user does exist, you can try running the following command via SSH as root to ensure that \/etc\/userdomains is updated to include all cPanel users listed in \/var\/cpanel\/users:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  \/usr\/local\/cpanel\/scripts\/updateuserdomains<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"extended_installation_instructions_with_screenshots\"><\/span>Extended Installation Instructions with Screenshots<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the extended instructions with screenshots for those who prefer more details regarding commands to run, what they do, and what output to expect:<\/p>\n\n\n\n<p>First, let&#8217;s log into our server as the root user via SSH (KnownHost uses SSH port 2200 by default) and install a few things via yum:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  yum -y install ea-ruby24-mod_passenger ea-ruby24-ruby-devel ImageMagick-devel sqlite-devel ea-apache24-mod_env ea-ruby24-rubygem-passenger ea-ruby24-rubygem-rack ea-ruby24-rubygem-rake ea-ruby24-rubygem-sqlite3\n  curl --silent --location https:\/\/rpm.nodesource.com\/setup_8.x | bash -\n  yum install nodejs<\/code><\/pre>\n\n\n\n<p>This will install our Ruby packages, ImageMagick, Sqlite, mod_env, mod_passenger, and NodeJS. The last command will prompt you to confirm the packages to be installed, and then prompt you to confirm the GPG key before completing the installation (just type&nbsp;<em>y<\/em>&nbsp;and then&nbsp;<em>Enter<\/em>&nbsp;to confirm the dependencies and the GPC Key:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1000\" height=\"621\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png\" alt=\"\" class=\"wp-image-574\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png 1000w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey-300x186.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey-768x477.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>You could just run&nbsp;<em>yum<\/em>&nbsp;with the flag&nbsp;<em>-y<\/em>&nbsp;to avoid these confirmation prompts.<\/p>\n\n\n\n<p>Let&#8217;s go ahead and install bundler.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  scl enable ea-ruby24 'gem install bundler'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"900\" height=\"138\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-geminstall-bundler.png\" alt=\"\" class=\"wp-image-575\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-geminstall-bundler.png 900w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-geminstall-bundler-300x46.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-geminstall-bundler-768x118.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>Next, let&#8217;s install a few more gems we will need:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  scl enable ea-ruby24 'gem install bundler bundle spring uglifier turbolinks rails'<\/code><\/pre>\n\n\n\n<p>The output is quite long, but you&#8217;ll want to watch to make sure all gems install. The last of the output should look like this (note that dependencies are also installed and I also chose to install documentation, which can be excluded with \u2013no-rdoc \u2013no-ri ):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"900\" height=\"257\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-gems-installed.png\" alt=\"\" class=\"wp-image-576\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-gems-installed.png 900w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-gems-installed-300x86.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-gems-installed-768x219.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>Create the cPanel account for use with Ruby on Rails unless you already have an existing cPanel account that you will be using for your Rails application (be sure to replace the username&nbsp;<em>mycpuser<\/em>&nbsp;with a username you&#8217;d like to use and then the domain&nbsp;<em>mycpdomain.tld<\/em>&nbsp;with your domain that will run the Rails applicaton). Skip this step if you will be using an existing user, but make sure that your existing user has shell access if you plan to run rails commands via SSH while creating your application.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  whmapi1 createacct username=mycpuser domain=mycpdomain.tld hasshell=1<\/code><\/pre>\n\n\n\n<p><em><strong>Note<\/strong><\/em>: We gave the user shell access via the&nbsp;<em>hasshell=1<\/em>&nbsp;above. We need to make sure the user has shell access enabled, otherwise they will see the following error:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/shell_access_not_enabled.png\" alt=\"\" class=\"wp-image-577\" width=\"741\" height=\"120\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/shell_access_not_enabled.png 700w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/shell_access_not_enabled-300x48.png 300w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><\/figure>\n\n\n\n<p><em><strong>Note<\/strong><\/em>: You may want to make sure to set the default shell to jailed shell&nbsp;<strong>if you are using CentOS kernel<\/strong>&nbsp;first as a jailed shell environment increases security and makes otherwise-unavailable commands (for example, crontab and passwd) available to users. Check the shell setting with this command (jailed shell is not set by default):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  whmapi1 get_tweaksetting key=jaildefaultshell<\/code><\/pre>\n\n\n\n<p>And set it with this command if not already set:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  whmapi1 set_tweaksetting key=jaildefaultshell value=1<\/code><\/pre>\n\n\n\n<p>Instead, you could use WHM&#8217;s Tweak Settings interface to set the default shell (WHM \u00bb Home \u00bbServer Configuration \u00bbTweak Settings)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"64\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/jailshell_tweak_settings-1024x64.png\" alt=\"\" class=\"wp-image-578\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/jailshell_tweak_settings-1024x64.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/jailshell_tweak_settings-300x19.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/jailshell_tweak_settings-768x48.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/jailshell_tweak_settings.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong><em>IMPORTANT<\/em><\/strong>&nbsp;Do not use Jailed Shell if you are using the Cloudlinux Kernel! You should use a regular shell instead if you want to run &#8216;rails&#8217; commands via SSH as the user. In this case, you would make sure that the default shell is set to &#8216;normal&#8217; instead.<\/p>\n\n\n\n<p>Allow the account to have Passenger Apps if they are not permitted to already:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  whmapi1 modifyacct user=mycpuser MAXPASSENGERAPPS=5<\/code><\/pre>\n\n\n\n<p>You can adjust this via WHM&#8217;s Modify an Account if you prefer the&nbsp;GUI&nbsp;(Home \u00bbAccount Functions \u00bbModify an Account).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"859\" height=\"1024\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/passenger_apps_allowed-859x1024.png\" alt=\"\" class=\"wp-image-579\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/passenger_apps_allowed-859x1024.png 859w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/passenger_apps_allowed-252x300.png 252w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/passenger_apps_allowed-768x916.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/passenger_apps_allowed.png 900w\" sizes=\"(max-width: 859px) 100vw, 859px\" \/><\/figure>\n\n\n\n<p>I chose to allow my user to have 5 Passenger Applications above. You may choose more, less, or unlimited.<\/p>\n\n\n\n<p>You will also want to check and confirm that, regardless of whether you chose a package or not (in which case the package will be&nbsp;<em>default<\/em>), that the Application Manager is available to your cPanel user&#8217;s package via WHM&#8217;s Feature Manager. You can do so via the command line like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  grep passengerapps \/var\/cpanel\/features\/*<\/code><\/pre>\n\n\n\n<p>If you see it listed, and set to &#8216;0&#8217;, then it is disabled for that particular Feature List. If you see no output, or see it listed and set to &#8216;1&#8217;, then it is enabled. You can that it is disabled on for the Mail Only Feature List on this server below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"91\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/feature-list.png\" alt=\"\" class=\"wp-image-580\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/feature-list.png 800w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/feature-list-300x34.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/feature-list-768x87.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Alternatively, you could log into WHM \u00bb Home \u00bbPackages \u00bbFeature Manager \u00bbFeature Lists and select the package to edit from the drop down list:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"347\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/select_edit_featurelist-1024x347.png\" alt=\"\" class=\"wp-image-581\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/select_edit_featurelist-1024x347.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/select_edit_featurelist-300x102.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/select_edit_featurelist-768x260.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/select_edit_featurelist.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Make sure that Application Manager is selected:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"695\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/application_manager_enabled-1024x695.png\" alt=\"\" class=\"wp-image-582\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/application_manager_enabled-1024x695.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/application_manager_enabled-300x204.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/application_manager_enabled-768x522.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/application_manager_enabled.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, create the Ruby App for your user in cPanel&#8217;s Application Manager:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  uapi --user=mycpuser PassengerApps register_application name=\"test_blog\" path=\"\/ruby_apps\/test_blog\" domain=\"mycpdomain.tld\" deployment_mode=\"development\" enabled=\"1\"<\/code><\/pre>\n\n\n\n<p>You will need to replace the values above with the values you&#8217;d like to use for the following keys in the command above:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>user<\/li>\n\n\n\n<li>name<\/li>\n\n\n\n<li>path<\/li>\n\n\n\n<li>domain<\/li>\n\n\n\n<li>deployment_mode<\/li>\n<\/ul>\n\n\n\n<p><em>Note:<\/em>&nbsp;I am using&nbsp;<em>mode=&#8221;development&#8221;<\/em>&nbsp;because I will be creating my Rails App from scratch. Use&nbsp;<em>mode=&#8221;production&#8221;<\/em>&nbsp;if you will be migrating an existing Rails app.<\/p>\n\n\n\n<p>To do so from the&nbsp;GUI, log into the newly created (or pre-existing) cPanel account and navigate to the Application Manager and click &#8220;Add Application&#8221; to fill in the required details:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"584\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-addapplication-1024x584.png\" alt=\"\" class=\"wp-image-583\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-addapplication-1024x584.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-addapplication-300x171.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-addapplication-768x438.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-addapplication.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click save. You can revisit Application Manager to ensure the application was added successfully:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"222\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-applicationmanager-1024x222.png\" alt=\"\" class=\"wp-image-584\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-applicationmanager-1024x222.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-applicationmanager-300x65.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-applicationmanager-768x166.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-applicationmanager.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, enable compilers. You could choose to do so globally:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  chmod 755 \/usr\/bin\/gcc<\/code><\/pre>\n\n\n\n<p>Alternatively, you can choose to only enable compilers for certain users (recommended) via WHM \u00bb Home \u00bbSecurity Center \u00bbCompiler Access<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"253\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_whm-1024x253.png\" alt=\"\" class=\"wp-image-585\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_whm-1024x253.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_whm-300x74.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_whm-768x189.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_whm.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You will see the following interface that will add the user to a&nbsp;<em>compiler<\/em>&nbsp;group to allow only the group access:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"885\" height=\"1024\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_specific_users_only-885x1024.png\" alt=\"\" class=\"wp-image-586\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_specific_users_only-885x1024.png 885w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_specific_users_only-259x300.png 259w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_specific_users_only-768x888.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/enable_compilers_specific_users_only.png 900w\" sizes=\"(max-width: 885px) 100vw, 885px\" \/><\/figure>\n\n\n\n<p>You could run the following commands to enable compiler for a single user if you prefer the command line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  usermod -a -G compiler mycpuser        # replace mycpuser with your cPanel username<\/code><\/pre>\n\n\n\n<p>Now, su to the user (SSH only):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  su mycpuser<\/code><\/pre>\n\n\n\n<p>Test&nbsp;<em>ruby<\/em>&nbsp;and&nbsp;<em>gem<\/em>&nbsp;commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  scl enable ea-ruby24 'ruby -v'\n  scl enable ea-ruby24 'gem -v'<\/code><\/pre>\n\n\n\n<p>You should see the version output from these commands if the installations were successful:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"900\" height=\"150\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/successcmds.png\" alt=\"\" class=\"wp-image-587\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/successcmds.png 900w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/successcmds-300x50.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/successcmds-768x128.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>Now, make the installation directory and change into it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  mkdir ruby_apps\n  cd ruby_apps\/<\/code><\/pre>\n\n\n\n<p>If you have tried running the commands&nbsp;<em>ruby<\/em>,&nbsp;<em>gem<\/em>, or&nbsp;<em>rails<\/em>&nbsp;up until now without the scl utility, you would get an error &#8220;command not found&#8221;. I personally prefer to use the command&nbsp;<em>rails<\/em>&nbsp;without using the Software Collections Library utility(<em>scl<\/em>). So, I&#8217;m going to add the following to edit my user&#8217;s .bashrc as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  echo 'export PATH=$PATH:\/opt\/cpanel\/ea-ruby24\/root\/usr\/bin\/' &gt;&gt; ~\/.bashrc\n  echo 'export PATH=$PATH:\/opt\/cpanel\/ea-ruby24\/root\/usr\/local\/bin\/' &gt;&gt; ~\/.bashrc \n  source ~\/.bashrc<\/code><\/pre>\n\n\n\n<p>Now you can see that these commands can be run without the scl utility.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"195\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/commandsw-outscl.png\" alt=\"Rails version\" class=\"wp-image-588\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/commandsw-outscl.png 800w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/commandsw-outscl-300x73.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/commandsw-outscl-768x187.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Now, we should make a test Rails application to confirm this is working. Run the following from within the&nbsp;<em>ruby_apps<\/em>&nbsp;directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  rails new test_blog<\/code><\/pre>\n\n\n\n<p>You should see output like this scrolling down the page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"675\" height=\"1024\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/output-ror-railsnew-675x1024.png\" alt=\"\" class=\"wp-image-589\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/output-ror-railsnew-675x1024.png 675w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/output-ror-railsnew-198x300.png 198w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/output-ror-railsnew-768x1165.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/output-ror-railsnew.png 900w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure>\n\n\n\n<p>Now, change into the newly generated Rails application and run &#8216;bundle install&#8217;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  cd test_blog\n  bundle install  --path vendor\/bundle<\/code><\/pre>\n\n\n\n<p>Now, you should be able to load the Rails default page via the domain in the browser:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"900\" height=\"548\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/dev-mode.png\" alt=\"Ruby on Rails Success page\" class=\"wp-image-590\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/dev-mode.png 900w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/dev-mode-300x183.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/dev-mode-768x468.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>When you created the app via the Application Manager, if you chose Production instead of Development, then you are probably seeing this error:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"900\" height=\"321\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-err.png\" alt=\"\" class=\"wp-image-591\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-err.png 900w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-err-300x107.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-err-768x274.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>This is because there is no route defined in config\/routes.rb. Here is the error as shown in \/home\/mycpuser\/ruby_apps\/test_blog\/log\/production.log:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-log-1024x543.png\" alt=\"\" class=\"wp-image-592\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-log-1024x543.png 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-log-300x159.png 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-log-768x407.png 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/ror-production-log.png 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, if you were going to upload a completed Rails application, you would have chosen &#8220;Production&#8221;, and then the application should work after setting up the gems, database and secret key since it already has routes defined.<\/p>\n\n\n<div class=\"kb-shortcode kb-shortcode_warning\">\n                    <div class=\"kb-shortcode-icon\">\n                        <i class=\"fa fa-exclamation-triangle fa-2x\"><\/i>\n                    <\/div>\n                    <div class=\"kb-shortcode-content_warning\">You cannot configure two Ruby applications to respond on the same domain, subdomain, addon domain, or page.<\/div>\n                <\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"special_considerations\"><\/span>Special Considerations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You may want to set up MySQL databases instead of SQLite3, and set them up via the cPanel interface so that they are included in backups and easily managed via cPanel. cPanel will check them for corruption and repair if possible, as well. MySQL is said to be far better for production than SQLite3, too. You would need to create the database, the database user, and the database user&#8217;s password, and then give the user permissions to access the database via the MySQL Database Wizard: (cPanel \u00bb Home \u00bb Databases \u00bb MySQL Database Wizard). Make sure to do this for each database you will need (test, development, and production). Be sure to also install the mysql2 gem as root so that it will available to your cPanel user.<\/p>\n\n\n\n<p>Setting up your Rails Application to use MySQL instead is pretty easy. You will need to remove sqlite3 from the Gemfile, install the mysql2 gem, edit the config\/database.yml file to use the mysql2 adapter, and restart the Rails application. Alternatively, you could choose to simply specify the database to use at the very beginning using&nbsp;<em>-d mysql<\/em>&nbsp;with&nbsp;<em>rails new<\/em>.<\/p>\n\n\n\n<p>Postgresql is another database that you can use with Rails. This database is also supported via cPanel as well. You must install this on your cPanel server first because it is not installed by default like MySQL is. Then, once installed, you will set up a database for your Rails Application, install the pg gem, edit the config\/database.yml file to use pg, and restart the Rails application. Just like recommended in the previous section regarding MySQL, you will need to do this for test, development, and production databases. Postgresql seems to be the more common database in use in the Rails community, though MySQL works great, too.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cPanel deprecated Ruby on Rails in cPanel &amp; WHM version 66 since it is not supported on CentOS 7 servers. Rails is a Ruby application, and they support Ruby applications via cPanel&#8217;s Application Manager interface (Home \u00bb Software \u00bb Application Manager), so this can&nbsp;technically&nbsp;be done. However, I cannot promise that it will run seamlessly forever [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[109,143,236,123,235,125],"class_list":["post-568","post","type-post","status-publish","format-standard","hentry","category-cpanel","tag-cpanel","tag-dedicated","tag-easyapache4","tag-linux","tag-ruby","tag-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Install Ruby on Rails on cPanel with EasyApache 4 | KnownHost<\/title>\n<meta name=\"description\" content=\"Starting a new Rails project? Follow this guide to see how to install Ruby on Rails on KnownHost servers using cPanel with EasyApache 4\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Ruby on Rails on cPanel with EasyApache 4 | KnownHost\" \/>\n<meta property=\"og:description\" content=\"Starting a new Rails project? Follow this guide to see how to install Ruby on Rails on KnownHost servers using cPanel with EasyApache 4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-05T13:07:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-23T12:33:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"621\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jonathan K. W.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan K. W.\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/\"},\"author\":{\"name\":\"Jonathan K. W.\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"headline\":\"Installing Ruby on Rails Apps on a cPanel\\\/CentOS 7 Server with EasyApache 4\",\"datePublished\":\"2021-07-05T13:07:07+00:00\",\"dateModified\":\"2026-01-23T12:33:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/\"},\"wordCount\":2330,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/confirmgpgkey.png\",\"keywords\":[\"cpanel\",\"dedicated\",\"easyapache4\",\"linux\",\"ruby\",\"vps\"],\"articleSection\":[\"cPanel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/\",\"name\":\"Install Ruby on Rails on cPanel with EasyApache 4 | KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/confirmgpgkey.png\",\"datePublished\":\"2021-07-05T13:07:07+00:00\",\"dateModified\":\"2026-01-23T12:33:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\"},\"description\":\"Starting a new Rails project? Follow this guide to see how to install Ruby on Rails on KnownHost servers using cPanel with EasyApache 4\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/confirmgpgkey.png\",\"contentUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/confirmgpgkey.png\",\"width\":1000,\"height\":621},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installing Ruby on Rails Apps on a cPanel\\\/CentOS 7 Server with EasyApache 4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\",\"name\":\"KnownHost\",\"description\":\"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/3db6e20d1f33519cd68fe0ba1230a48b\",\"name\":\"Jonathan K. W.\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g\",\"caption\":\"Jonathan K. W.\"},\"sameAs\":[\"https:\\\/\\\/www.knownhost.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Ruby on Rails on cPanel with EasyApache 4 | KnownHost","description":"Starting a new Rails project? Follow this guide to see how to install Ruby on Rails on KnownHost servers using cPanel with EasyApache 4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/","og_locale":"en_US","og_type":"article","og_title":"Install Ruby on Rails on cPanel with EasyApache 4 | KnownHost","og_description":"Starting a new Rails project? Follow this guide to see how to install Ruby on Rails on KnownHost servers using cPanel with EasyApache 4","og_url":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/","og_site_name":"KnownHost","article_published_time":"2021-07-05T13:07:07+00:00","article_modified_time":"2026-01-23T12:33:36+00:00","og_image":[{"width":1000,"height":621,"url":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png","type":"image\/png"}],"author":"Jonathan K. W.","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jonathan K. W.","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/"},"author":{"name":"Jonathan K. W.","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"headline":"Installing Ruby on Rails Apps on a cPanel\/CentOS 7 Server with EasyApache 4","datePublished":"2021-07-05T13:07:07+00:00","dateModified":"2026-01-23T12:33:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/"},"wordCount":2330,"commentCount":0,"image":{"@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png","keywords":["cpanel","dedicated","easyapache4","linux","ruby","vps"],"articleSection":["cPanel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/","url":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/","name":"Install Ruby on Rails on cPanel with EasyApache 4 | KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#primaryimage"},"image":{"@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png","datePublished":"2021-07-05T13:07:07+00:00","dateModified":"2026-01-23T12:33:36+00:00","author":{"@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b"},"description":"Starting a new Rails project? Follow this guide to see how to install Ruby on Rails on KnownHost servers using cPanel with EasyApache 4","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#primaryimage","url":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png","contentUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/07\/confirmgpgkey.png","width":1000,"height":621},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/kb\/installing-ruby-rails-apps-on-a-cpanel-centos-7-server-with-easyapache-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/kb\/"},{"@type":"ListItem","position":2,"name":"Installing Ruby on Rails Apps on a cPanel\/CentOS 7 Server with EasyApache 4"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/kb\/#website","url":"https:\/\/www.knownhost.com\/kb\/","name":"KnownHost","description":"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/3db6e20d1f33519cd68fe0ba1230a48b","name":"Jonathan K. W.","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f432b99e6651fe8d1deb57a285bd84e806f1c9ae8b4c6c585d7e3a0b33789ad9?s=96&d=mm&r=g","caption":"Jonathan K. W."},"sameAs":["https:\/\/www.knownhost.com"]}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/comments?post=568"}],"version-history":[{"count":1,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":8032,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/568\/revisions\/8032"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/media?parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/categories?post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/tags?post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}