This document describes how to install Sinatra web application. in cPanel's Application Manager interface (cPanel >> Home >> Software >> Application Manager).
- cPanel Technical Support does not provide assistance with the steps in this document.
- We recommend that only experienced system administrators perform these steps.
- We are not responsible for any data loss.
- We recommend that you perform the steps in this document via the command line as a cPanel user unless otherwise specified.
- You can also use cPanel's Terminal interface ( cPanel >> Home >> Advanced >> Terminal) to perform these steps in cPanel & WHM version 72 and later.
- In this document,
user represents the cPanel user, and
frank represents the application's name.
For more information, read Sinatra's documentation.
Before you begin, make certain that the following EasyApache 4 RPMs exist on your server:
ea-apache24-mod_env module allows you to add environment variables when you register your application. For more information about environment variables, read our Application Manager documentation.
If you need to install these RPMs, run the following command as the
yum install ea-ruby24-mod_passenger ea-ruby24-ruby-devel ea-apache24-mod_env
To install the
sinatra Ruby gem, run the following command:
scl enable ea-ruby24 'gem install sinatra'
If you do not wish to use the
scl utility, perform the following steps to install the
sinatra Ruby gem:
Log in to the server as a cPanel user.
Add the following line to your shell's
rc file (for example,
Log out of your terminal session, and log back in again.
You can also create an additional terminal session.
- Run the
gem install sinatra command
Create the application's directory path.
After you install the
sinatra Ruby gem, create the application's directory path, relative to your home directory, for example:
Create the application's ruby files.
After you create the application's directory path, add the ruby application file. To do this, perform the following steps:
- Change to the application's directory
- Create the
app.rb file with a text editor.
Add the process that you want the application to execute, for example:
class Fools < Sinatra::Base
get '/' do
'Fools Rush In'
For more information about how to add processes to the
app.pp file, read Sinatra's documentation.
- Create the
config.rb file with a text editor.
Add the following content to the file:
After you create the application's Apache configuration, restart Apache. To do this, run the following command as the root user:
After Apache restarts, you can access the application in cPanel's Application Manager interface (cPanel >> Home >> Software >> Application Manager).