JUST IN – Iran's Foreign Ministry designates all EU naval and air forces as terrorist organizations, following the EU's decision to classify the IRGC as a terrorist organization.

This article explains how to install and configure Sinatra Ruby applications, create Ruby web applications using Passenger, and customize PHP directives with .user.ini files in cPanel. It includes system requirements, installation steps, file setup, application registration, and Apache restart instructions.

Sinatra RubyRuby Web ApplicationsPHP Directives

~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_passenger
  • ea-ruby27-ruby-devel
  • ea-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_application function

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_env
  • ea-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

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue