Page tree
Skip to end of metadata
Go to start of metadata

Overview

This document discusses how to create an EasyApache 4 (EA4) profile.

Note:

The system strips the prefix from the package name in the EasyApache 4 interface. 

About EasyApache 4 profiles

EasyApache 4 profiles are JSON files. While EasyApache 4 provides a number of profiles that will suit most needs, you may wish to create your own to further customize your server. 

To create a profile, you can either convert your existing configuration to a profile, click Save as profile during the configuration process, or download one of the provided profiles, customize it, then upload it to the server in the EasyApache 4 interface (Home >> Software >> EasyApache 4). You can also create your own by hand and either upload it or create it directly on the server. 

Convert to profile

In cPanel & WHM version 66 and later, you can convert your existing configuration into a profile. This allows you to easily configure your profile in the interface, and then save it. To convert your configuration into a custom profile, perform the following steps:

  1. Click Convert to profile in the Currently Installed Packages section. 
  2. Enter the name of your profile. This is the name that the EasyApache 4 interface will display. 
  3. Enter the file name of your profile. Do not include an extension.

    Note:

    You cannot enter a file name of . or .., or a file name that contains the / or NUL character.

  4. Enter a description for your profile, if desired. The interface will display this description.
  5. Enter any tags that you want to use, separated by commas
  6. If you want to overwrite an existing profile of the same name, select the Overwrite an existing profile checkbox.
  7. Click Convert

Your new profile will save to the /etc/cpanel/ea4/profiles/custom directory.

Note:

You can also use the scripts in the ea-config-tools RPM, but this does not provide as many options. 

Save as profile

In cPanel & WHM version 66 and later, you can save a new profile at any point during the EasyApache 4 configuration process. This feature allows you to easily configure your profile in the interface, and then save it. To save your configuration as a profile, perform the following steps:

  1. Click Save as profile during the EasyApache 4 configuration process. 
  2. Enter the name of your profile. This is the name that the EasyApache 4 interface will display. 
  3. Enter the file name of your profile. Do not include an extension. 

    Note:

    You cannot enter a file name of . or .. , or a file name that contains the / or NUL character.

  4. Enter a description for your profile, if desired. The interface will display this description.
  5. Enter any tags that you want to use, separated by commas. 
  6. If you want to overwrite an existing profile of the same name, select the Overwrite an existing profile checkbox.
  7. Click Save

Your new profile will save to the /etc/cpanel/ea4/profiles/custom directory.

Upload a file

The easiest way to create an EasyApache 4 profile on systems that run cPanel & WHM version 64 is to create the file and then upload it in the EasyApache 4 interface (Home >> Software >> EasyApache 4). This action ensures that your profile saves to the proper location and that a file does not already exist with the selected file name. All custom profiles save to the /etc/cpanel/ea4/profiles/custom directory. 

Note:

We strongly recommend that you download a current EasyApache 4 profile and modify it to meet your needs. If you download an existing profile, it will already be in JSON format.

Example profile

Your EasyApache 4 profile file must be a JSON file that resembles the following example: 

{  
   "version":"1.2",
   "name":"SuperHost Profile",
   "tags":[  
      "Apache 2.4",
      "PHP 5.4",
      "tomorrow comes knocking",
      "…"
   ],
   "desc":"This profile will allow you to have super high density on your system",
   "pkgs":[  
      "ea-mod_xyz",
      "ea-php54",
      "ea-php56",
      "ea-your_frog",
      "…"
   ]
}

The following table explains the above keys:

KeyTypeDescriptionExample
versionintegerThe profile's version.1.2
namestringThe profile name that WHM displays.SuperHost Profile
tagsarray of stringsA list of tags that WHM displays.Apache 2.4, PHP 5.4
descstringA description of the profile that WHM displays.This profile will allow you to have super high density on your system
pkgsarray of stringsThe packages in the profile.ea-php54,ea-php56

Create an EA4 profile directly on the server

Remember:

You can upload a file from the EasyApache 4 interface on a system that runs cPanel & WHM version 64 or higher.

  1. Navigate to the /etc/cpanel/ea4/profiles/custom directory.

     

    Important:

    Always save your profiles in the /etc/cpanel/ea4/profiles/custom/ directory. The system uniquely uses the /etc/cpanel/ea4/profiles/cpanel and /etc/cpanel/ea4/profiles/vendor directories. These files may work initially if you use them, but they will likely disappear or not function as you might expect.

  2. With a text editor, create a JSON file with your preferred settings. For more information about file format, read the JSON section. 

  3. After you create the JSON file and save your changes, check for proper syntax. To do this, run the following command, where custom_profile_name.json represents your JSON file:

    /usr/local/cpanel/3rdparty/perl/522/bin/json_pp -t null < custom_profile_name.json

    Note:

    The tool accepts the following options:

    • The -f flag passes the file's input format. For example, json.
    • The -t flag passes the file's output format. For example, dumper.
    • The -json_opt flag passes format options in which to print information to the JSON:PP module (for example, pretty).

    For more information, read cpan.org's JSON::PP command utility documentation.

    If the command does not return output, your JSON file's syntax is correct.

  4. Navigate to the EasyApache 4 interface (Home >> Software >> EasyApache 4) and verify that your profile appears. 

Create a default profile for a fresh cPanel & WHM install

EasyApache 4 allows you to preconfigure your profile before you install cPanel & WHM version 58 or higher on your server.

To preconfigure your profile, create the /etc/cpanel_initial_install_ea4_profile.json file.

Warning:

You must create this profile as a valid JSON file and a valid EasyApache 4 profile.

The system will install this profile and then copy it to the/etc/cpanel/ea4/profiles/custom/ directory when the system completes the installation.

Note:

If your JSON file contains errors, no data, or the installation fails, the system installs the default EasyApache 4 profile.