~3 min read • Updated Feb 21, 2026
1. How to Create a Sinatra Ruby Application
Warning: cPanel does not develop or support Sinatra applications. Only experienced system administrators should perform these steps. Your hosting provider must enable this feature and install the required EasyApache 4 RPMs.
You can perform all steps via SSH or through cPanel’s Terminal interface.
To use this feature, the cPanel account must have compiler access enabled in WHM’s Compiler Access interface. Otherwise, the system will return an error such as:
make: execvp: gcc: Permission denied
1.1 Pre‑Installation Requirements
Ensure the following EasyApache 4 RPMs are installed:
ea-ruby27-mod_passengerea-ruby27-ruby-develea-apache24-mod_env
To install them:
yum install ea-ruby27-mod_passenger ea-ruby27-ruby-devel ea-apache24-mod_env
1.2 Install the Sinatra Gem
Install Sinatra using:
scl enable ea-ruby27 'gem install sinatra'
If you prefer not to use scl:
- Log in as a cPanel user.
- Add this line to your shell rc file (e.g.,
~/.bashrc):
source /opt/cpanel/ea-ruby27/enable
Log out and back in, then run:
gem install sinatra
1.3 Create the Application Directory
Create a directory for your application, for example:
/home/username/application
1.4 Create the Ruby Application Files
Inside the application directory, create app.rb:
require 'sinatra/base'
class Fools < Sinatra::Base
get '/' do
'Fools Rush In'
end
end
Create config.ru:
require File.absolute_path("app.rb")
run Fools
1.5 Register the Application
You can register the application using:
- cPanel’s Application Manager
- UAPI’s
PassengerApps::register_applicationfunction
1.6 Restart Apache
Optional but recommended:
/usr/local/cpanel/scripts/restartsrv_httpd
After Apache restarts, the application appears in Application Manager.
2. How to Create Ruby Web Applications
Warning: Legacy Ruby and Ruby on Rails support was deprecated in cPanel & WHM version 66. Only Passenger-based Ruby applications are supported.
To use this feature, the cPanel account must have compiler access enabled.
2.1 Install Ruby via Passenger
Install Ruby using EasyApache 4:
ea-ruby27-mod_passenger
Optional RPMs for environment variables:
ea-apache24-mod_envea-ruby27-ruby-devel
2.2 Create a Ruby Web Application
You can create Ruby applications such as:
- Sinatra applications
- Jekyll applications
After creating the application, register it in:
cPanel » Home » Software » Application Manager
3. How to Customize PHP Directives
The .user.ini file allows you to customize PHP directives on a per‑directory basis.
3.1 System Requirements
- PHP 5.3.0 or later
- Cannot use the DSO PHP handler
3.2 Create a .user.ini File
Steps:
- Log in to cPanel
- Open File Manager
- Enable “Show hidden files”
- Navigate to the target directory
- Create a file named
.user.ini - Edit the file and add your PHP directives
- Save the file
Important: The filename must begin with a period.
Conclusion
This guide provides complete instructions for creating Sinatra Ruby applications, building Ruby web applications using Passenger, and customizing PHP directives with .user.ini. These tools allow developers and system administrators to deploy modern applications and fine‑tune PHP behavior on cPanel servers.
Written & researched by Dr. Shahin Siami