KNOWNHOST WIKI

User Tools

Site Tools


developmental:ruby-rails-apps-cpanel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
developmental:ruby-rails-apps-cpanel [2019/06/06 08:24]
Jonathan K. W.
developmental:ruby-rails-apps-cpanel [2019/10/11 08:08]
Karson N.
Line 173: Line 173:
 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 //y// and then //Enter// to confirm the dependencies and the GPC Key: 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 //y// and then //Enter// to confirm the dependencies and the GPC Key:
  
-{{:developmental:confirmgpgkey.png?direct&1000|}}+{{:developmental:confirmgpgkey.png?nolink&1000|}}
  
 You could just run //yum// with the flag //-y// to avoid these confirmation prompts.  You could just run //yum// with the flag //-y// to avoid these confirmation prompts. 
Line 181: Line 181:
   scl enable ea-ruby24 'gem install bundler'   scl enable ea-ruby24 'gem install bundler'
  
-{{:developmental:ror-geminstall-bundler.png?direct&900|}}+{{:developmental:ror-geminstall-bundler.png?nolink&900|}}
  
 Next, let's install a few more gems we will need: Next, let's install a few more gems we will need:
Line 189: Line 189:
 The output is quite long, but you'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 --no-rdoc --no-ri  ): The output is quite long, but you'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 --no-rdoc --no-ri  ):
  
-{{:developmental:ror-gems-installed.png?direct&900|}}+{{:developmental:ror-gems-installed.png?nolink&900|}}
  
 Create the cPanel account for use with Rails unless you already have an existing cPanel account that you will be using for your Rails application (be sure to replace the username //mycpuser// with a username you'd like to use and then the domain //mycpdomain.tld// 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. Create the cPanel account for use with Rails unless you already have an existing cPanel account that you will be using for your Rails application (be sure to replace the username //mycpuser// with a username you'd like to use and then the domain //mycpdomain.tld// 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.
Line 197: Line 197:
 //**Note**//: We gave the user shell access via the //hasshell=1// above. We need to make sure the user has shell access enabled, otherwise they will see the following error: //**Note**//: We gave the user shell access via the //hasshell=1// above. We need to make sure the user has shell access enabled, otherwise they will see the following error:
  
-{{:developmental:shell_access_not_enabled.png?direct&700|}}+{{:developmental:shell_access_not_enabled.png?nolink&700|}}
  
 //**Note**//: You may want to make sure to set the default shell to jailed shell **if you are using CentOS kernel** 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): //**Note**//: You may want to make sure to set the default shell to jailed shell **if you are using CentOS kernel** 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):
Line 209: Line 209:
 Instead, you could use WHM's Tweak Settings interface to set the default shell (WHM >> Home »Server Configuration »Tweak Settings) Instead, you could use WHM's Tweak Settings interface to set the default shell (WHM >> Home »Server Configuration »Tweak Settings)
  
-{{:developmental:jailshell_tweak_settings.png?direct&1200|}}+{{:developmental:jailshell_tweak_settings.png?nolink&1200}}
  
 **//IMPORTANT//** Do not use Jailed Shell if you are using the Cloudlinux Kernel! You should use a regular shell instead if you want to run 'rails' commands via SSH as the user.  In this case, you would make sure that the default shell is set to 'normal' instead.  **//IMPORTANT//** Do not use Jailed Shell if you are using the Cloudlinux Kernel! You should use a regular shell instead if you want to run 'rails' commands via SSH as the user.  In this case, you would make sure that the default shell is set to 'normal' instead. 
Line 219: Line 219:
 You can adjust this via WHM's Modify an Account if you prefer the GUI (Home »Account Functions »Modify an Account).  You can adjust this via WHM's Modify an Account if you prefer the GUI (Home »Account Functions »Modify an Account). 
  
-{{:developmental:passenger_apps_allowed.png?direct&900|}}+{{:developmental:passenger_apps_allowed.png?nolink&900|}}
  
 I chose to allow my user to have 5 Passenger Applications above. You may choose more, less, or unlimited.  I chose to allow my user to have 5 Passenger Applications above. You may choose more, less, or unlimited. 
Line 229: Line 229:
 If you see it listed, and set to '0', then it is disabled for that particular Feature List. If you see no output, or see it listed and set to '1', then it is enabled. You can that it is disabled on for the Mail Only Feature List on this server below: If you see it listed, and set to '0', then it is disabled for that particular Feature List. If you see no output, or see it listed and set to '1', then it is enabled. You can that it is disabled on for the Mail Only Feature List on this server below:
  
-{{:developmental:feature-list.png?direct&800|}}+{{:developmental:feature-list.png?nolink&800|}}
  
 Alternatively, you could log into WHM >>  Home »Packages »Feature Manager »Feature Lists and select the package to edit from the drop down list: Alternatively, you could log into WHM >>  Home »Packages »Feature Manager »Feature Lists and select the package to edit from the drop down list:
  
-{{:developmental:select_edit_featurelist.png?direct&1200|}}+{{:developmental:select_edit_featurelist.png?nolink&1200|}}
  
 Make sure that Application Manager is selected: Make sure that Application Manager is selected:
  
-{{:developmental:application_manager_enabled.png?direct&1200|}}+{{:developmental:application_manager_enabled.png?nolink&1200|}}
  
 Now, create the Ruby App for your user in cPanel's Application Manager: Now, create the Ruby App for your user in cPanel's Application Manager:
Line 254: Line 254:
 To do so from the GUI, log into the newly created (or pre-existing) cPanel account and navigate to the Application Manager and click "Add Application" to fill in the required details: To do so from the GUI, log into the newly created (or pre-existing) cPanel account and navigate to the Application Manager and click "Add Application" to fill in the required details:
  
-{{:developmental:ror-addapplication.png?direct&1200|}}+{{:developmental:ror-addapplication.png?nolink&1200|}}
  
 Click save. You can revisit Application Manager to ensure the application was added successfully: Click save. You can revisit Application Manager to ensure the application was added successfully:
  
-{{:developmental:ror-applicationmanager.png?direct&1200|}}+{{:developmental:ror-applicationmanager.png?nolink&1200|}}
  
  
Line 267: Line 267:
 Alternatively, you can choose to only enable compilers for certain users (recommended) via WHM >>  Home »Security Center »Compiler Access  Alternatively, you can choose to only enable compilers for certain users (recommended) via WHM >>  Home »Security Center »Compiler Access 
  
-{{:developmental:enable_compilers_whm.png?direct&1200|}}+{{:developmental:enable_compilers_whm.png?nolink&1200|}}
  
 You will see the following interface that will add the user to a //compiler// group to allow only the group access: You will see the following interface that will add the user to a //compiler// group to allow only the group access:
  
-{{:developmental:enable_compilers_specific_users_only.png?direct&900|}}+{{:developmental:enable_compilers_specific_users_only.png?nolink&900|}}
  
 You could run the following commands to enable compiler for a single user if you prefer the command line: You could run the following commands to enable compiler for a single user if you prefer the command line:
Line 288: Line 288:
 You should see the version output from these commands if the installations were successful: You should see the version output from these commands if the installations were successful:
  
-{{:developmental:successcmds.png?direct&900|}}+{{:developmental:successcmds.png?nolink&900|}}
  
 Now, make the installation directory and change into it: Now, make the installation directory and change into it:
Line 304: Line 304:
 Now you can see that these commands can be run without the scl utility. Now you can see that these commands can be run without the scl utility.
  
-{{:developmental:commandsw-outscl.png?direct&600|}}+{{:developmental:commandsw-outscl.png?nolink&800|}}
  
 Now, we should make a test Rails application to confirm this is working. Run the following from within the //ruby_apps// directory:  Now, we should make a test Rails application to confirm this is working. Run the following from within the //ruby_apps// directory: 
Line 312: Line 312:
 You should see output like this scrolling down the page: You should see output like this scrolling down the page:
  
-{{:developmental:output-ror-railsnew.png?direct&900|}}+{{:developmental:output-ror-railsnew.png?nolink&900|}}
  
 Now, change into the newly generated Rails application and run 'bundle install': Now, change into the newly generated Rails application and run 'bundle install':
Line 321: Line 321:
 Now, you should be able to load the Rails default page via the domain in the browser: Now, you should be able to load the Rails default page via the domain in the browser:
  
-{{:developmental:dev-mode.png?direct&900|}}+{{:developmental:dev-mode.png?nolink&900|}}
  
 When you created the app via the Application Manager, if you chose Production instead of Development, then you are probably seeing this error: When you created the app via the Application Manager, if you chose Production instead of Development, then you are probably seeing this error:
  
-{{:developmental:ror-production-err.png?direct&900|}}+{{:developmental:ror-production-err.png?nolink&900|}}
  
 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: 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:
  
-{{:developmental:ror-production-log.png?direct&1200|}}+{{:developmental:ror-production-log.png?nolink&1200|}}
  
 Now, if you were going to upload a completed Rails application, you would have chosen "Production", and then the application should work after setting up the gems, database and secret key since it already has routes defined. Now, if you were going to upload a completed Rails application, you would have chosen "Production", and then the application should work after setting up the gems, database and secret key since it already has routes defined.
developmental/ruby-rails-apps-cpanel.txt · Last modified: 2020/06/16 16:10 by Karson N.