TECHIES WORLD

For Techs.... Techniques.... Technologies....

ApacheCpanelLinuxPHP

How to install apache/php module using Easyapache4

The stable version of cpanel got changed to 58 now which have easyapache4 in it by default. In the this latest version we could not recompile apache/php by running the command "/scripts/easyapache" as this command belongs to easyapache3 which is deprecated now.

Cpanel promoting the apache/php module installations via front panel in these latest versions. But still we can install apache/php modules via command-line.

Cpanel now builds RPM packages with binaries that easily install using yum instead of taking the long route of compiling binaries from the source. So we can install apache/php modules simply using yum command.

Also easyapache4 using its own repository "/etc/yum.repos.d/EA4.repo" for apache/php related packages.

We can list the available packages using the below commands.

For apache related packages,

#yum list available | grep ea-apache*

For php related packages,

#yum list available | grep ea-php*

For example if we need to install the apache module "remoteip_module" please follow the below steps.

Step1: Search for the module packages

#yum list available | grep ea-apache* | grep remoteip

Step2: Install the resulted package using yum.

#yum install ea-apache24-mod_remoteip.x86_64

We can install the any available modules of apache/php by this method.

Also we can create profiles in easyapache4 based on our custom needs. This profile must be a json file.

Cpanel default profiles will be available in the folder '/etc/cpanel/ea4/profiles/cpanel/'. We can create custom profiles in the folder '/etc/cpanel/ea4/profiles/custom/' as json files.

Please note that the syntax of json files should be correct, otherwise we will get error while doing recompilation.

As a saftey measure we can create the json file for current settings and modify it according to our needs.

#/usr/local/bin/ea_current_to_profile --output=/etc/cpanel/ea4/profiles/custom/current.json

Now we can edit the file 'etc/cpanel/ea4/profiles/custom/current.json' according to our requirements.

For installing the new profile, use the below command.

#/usr/local/bin/ea_install_profile --install /etc/cpanel/ea4/profiles/cpanel/default.json

If the installation is fine, it will display the following message.

Finished Transaction
Leaving Shell

Note that easyapache4 allows to run multiple versions of PHP at the same time. We can select the default version of PHP by modifying the file '/etc/cpanel/ea4/php.conf'. Here we need to update the line "default:" with the required version of php and restart apache service.

Leave a Reply