cPanel, Inc. ships many of cPanel & WHM's third-party dependencies as RPMs. In order to customize these dependencies on your server, you must custom-build the RPM and then reinstall it. For example, use this method to build and install Roundcube customizations in cPanel & WHM version 58 and later.
You must log in through SSH as the
root user to install an RPM.
Before you begin
Perform the following steps to ensure your system's readiness to build and install an RPM:
Use the following command to install the
rpm-build package on your system:
devel target for cPanel & WHM
check_cpanel_rpms scripts before you install a custom RPM. These scripts ensure that the
devel target is enabled and up-to-date. The
devel target installs the
devel versions of RPMs, which cPanel & WHM uses to compile SRPMs locally.
To do this, run the following commands:
To rebuild some cPanel-provided RPMs, you may need to install additional RPMs that cPanel & WHM does not include in default installations. These additional RPMs contain files that the system only needs to rebuild, but not run, the cPanel-provided RPMs.
Install additional prerequisites
Before you can build and install a custom-built RPM, you must install all of the RPM's prerequisites. You can find all of an RPM's prerequisites, and the required version numbers, in its
- Lines in the
.specfile that begin with
BuildRequires:indicate a prerequisite that the RPM requires for the build process.
- Lines in the
.specfile that begin with
Requires:indicate a prerequisite that the RPM requires for installation.
BuildRequires: cpanel-mysql >= 5.0.95 indicates that the RPM requires the
cpanel-mysql RPM of MySQL® version 5.0.95 or higher.
Ensure that you have installed all necessary RPMs
/scripts/sysup script to ensure that you have installed all of the prerequisite RPMs.
- If all of these RPMs exist on your server, you will receive the following message:
All Needed RPMS are installed.
- If you receive an error message, correct those installation problems first to avoid additional errors when you build and install your custom RPM.
Build and install custom RPMs
Perform the following steps to build and install Roundcube customizations in cPanel & WHM version 58 and later:
Create the .rpmmacros file
Use your preferred text editor to create the
.rpmmacros file in the
Add the following contents to the file:
Create the directories to rebuild the RPM
If not present on your server, create the following directories:
Run the following command to create these directories:
You must use these names for the
SRPMS directories. You must capitalize the entire name for each of these directories.
Install the source RPM
rpm command to install the source RPM (SRPM).
.specfile will install to the
- The source tarball, patches, and any additional files for the RPM will install to the
You can find the correct SRPM for your version of cPanel & WHM on our httpupdate server. Click on your server's version of cPanel & WHM, and then click on the
src/ directory to view a list of all available SRPMs for that version.
Your command will resemble the following example:
When the installation finishes, you will see a message that resembles the following example:
Use your preferred text editor to modify the
.spec file in the
/root/rpmbuild/SPECS/ directory. Add the desired configuration settings for your RPM.
To change any of the sources that ship with the SRPM, modify the files in the
The following example section of a
.spec file includes the
Rebuild the RPM
rpmbuild command on the modified
.spec file to build the new RPM locally. Your command should resemble the following example:
rpmbuild tool writes the RPM and any subpackages to the
The system may report dependencies issues when you run this command. If so, install these dependencies with
yum before you continue.
Run the command to update your RPM with force
Navigate to the
/root/rpmbuild/RPMS/ directory and run the
rpm command to install your new custom-built RPM.
Your command will resemble the following example, where
cpanel-php54-5.4.23-4.cp1142.x86_64.rpm represents the RPM that you wish to update:
Prevent unintentional updates
This step is optional and may freeze updates to this RPM and prevent future cPanel & WHM upgrades. However, if you do not perform this step, cPanel & WHM may overwrite your custom RPM on its next update or upgrade.
To prevent unintentional updates, add your custom RPM to the list of local RPMs in the
/scripts/update_local_rpm_versions script. Your command will resemble the following example:
To verify your custom RPM's configuration, view the
The contents of the
local.versions file should resemble the following example:
Return to the cPanel & WHM version of an RPM
Perform the following steps if you wish to return to the cPanel & WHM version of an RPM:
Run the following command to remove the custom RPM from the
Run the following script to reinstall the cPanel & WHM version of the RPM:
There is no content with the specified labels