### Install and Start firewalld Service Source: https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-configure-your-firewall-for-cpanel-services Ensure the firewalld service is installed and running on your system. Enable it to start automatically on server boot. ```bash yum install firewalld ``` ```bash systemctl start firewalld.service ``` ```bash systemctl enable firewalld ``` -------------------------------- ### Example: Install cPanel/WHM Assuming AlmaLinux 8.4 Source: https://docs.cpanel.net/installation-guide/experimental-installation-on-unsupported-operating-systems This example forces the installer to assume the operating system is AlmaLinux OS version 8.4. This is useful when installing on a system that is not detected correctly but is compatible. ```bash sh latest --experimental-os=almalinux-8.4 ``` -------------------------------- ### Example Module Include Path Source: https://docs.cpanel.net/whm/software/php-pecl This is an example of the filepath where the system installs PHP PECL modules. ```text /opt/cpanel/ea-php55/root/usr/lib64/php/modules ``` -------------------------------- ### Install quota_v2 Module Source: https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-fix-quotas Install the appropriate quota_v2 module for your server using this command. Replace `$example` with the name of the correct quota_v2 module identified from the kernel metapackage. ```bash apt install $example ``` -------------------------------- ### Install Third-Party Container with Risk Acknowledgment Source: https://docs.cpanel.net/ea4/containers/the-ea-podman-script Example of installing a third-party container, including volume mounting and explicitly acknowledging the risks involved. ```bash ea-podman install mymongo -v $HOME:/home/user docker.io/library/mongo:latest --i-understand-the-risks-do-it-anyway ``` -------------------------------- ### Example 'no package available' Error Source: https://docs.cpanel.net/knowledge-base/package-management/rpm-installation-failures This example shows an RPM installation failure due to the 'wget' package not being available on the server. It indicates that the system could not find the required package. ```bash [20130131.123334] Setting up Install Process [20130131.123334] No package wget available. [20130131.123335] Nothing to do [20130131.123339] E Sysup: Needed system RPMs were not installed: wget [20130131.123339] ***** FATAL: Cannot proceed. Needed system RPMs were not installed. [20130131.123339] The Administrator will be notified to review this output when this script completes [20130131.123339] E Detected events which require user notification during updatenow. Will send iContact the log => Log closed Thu Jan 31 12:33:39 2013 [20130131.123339] E Running `/usr/local/cpanel/scripts/updatenow --upcp --log=/var/cpanel/updatelogs/update.1359657200.log` failed, exited with code 4608 => Log closed Thu Jan 31 12:33:39 2013 ``` -------------------------------- ### Example my.cnf with Client SSL Configuration Source: https://docs.cpanel.net/knowledge-base/security/how-to-configure-mysql-ssl-connections This example shows a complete `/etc/my.cnf` file with the client SSL configuration added to the `[client]` section. Ensure the `[client]` section exists or is added. ```ini [mysqld] max_connections=500 log-slow-queries max_allowed_packet=268435456 open_files_limit=10000 default-storage-engine=MyISAM innodb_file_per_table=1 performance-schema=0 [client] ssl-mode=REQUIRED ssl-cert=/mysql_keys/client-cert.pem ssl-key=/mysql_keys/client-key.pem ``` -------------------------------- ### Example cpupdate.conf File Format Source: https://docs.cpanel.net/knowledge-base/cpanel-product/the-cpanel-update-configuration-file-cpupdate-conf This example demonstrates the basic KEY=value format for the /etc/cpupdate.conf file. Each setting must be on a new line, with no spaces. ```bash CPANEL=release RPMUP=daily SARULESUP=daily STAGING_DIR=/usr/local/cpanel UPDATES=daily ``` -------------------------------- ### Document Root Directories for WordPress Installations Source: https://docs.cpanel.net/knowledge-base/third-party/how-to-install-wordpress-with-cpanel Examples of document root directories where WordPress can be installed. Each directory should contain only one WordPress installation. ```text /home/example/public_html/ ``` ```text /home/example/public_html/addon.com ``` ```text /home/example/public_html/subdomain ``` -------------------------------- ### Run the setupftpserver Script Source: https://docs.cpanel.net/whm/scripts/the-setupftpserver-script Use this format to execute the setupftpserver script from the command line. Specify options and the desired FTP server. ```bash /usr/local/cpanel/scripts/setupftpserver options ftpserver ``` -------------------------------- ### Example system.yaml Configuration Source: https://docs.cpanel.net/knowledge-base/php-fpm/php-fpm-code-and-filesystem-layout-for-easyapache-4 This example shows the content of the system.yaml file, specifically configuring the daemonize setting for PHP-FPM. ```yaml --- demonize: yes ``` -------------------------------- ### Example: Swap IP for a Domain Source: https://docs.cpanel.net/whm/scripts/the-swapip-script This example demonstrates how to change the IP address for the 'example.com' domain. It updates the A record to point HTTP and FTP requests from '10.0.0.0' to '172.16.0.0'. ```bash /usr/local/cpanel/bin/swapip 10.0.0.0 172.16.0.0 172.16.0.0 example.com ``` -------------------------------- ### Dovecot FTS Installation Output Source: https://docs.cpanel.net/whm/scripts/the-install_dovecot_fts-script This is an example of the output you may see when the Dovecot FTS installation script completes successfully. It indicates the successful installation of the cpanel-dovecot-solr package. ```bash Loaded plugins: fastestmirror, tsflags, universal-hooks Loading mirror speeds from cached hostfile * EA4: 208.74.121.37 Resolving Dependencies --> Running transaction check --> Finished Dependency Resolution Downloading packages: Running transaction check Running transaction test Transaction test succeeded Installing : cpanel-dovecot-solr-6.6.2-8.1.noarch 1/1 Verifying : cpanel-dovecot-solr-6.6.2-8.1.noarch 1/1 Complete! ``` -------------------------------- ### WordPress Installations in Subdirectories Source: https://docs.cpanel.net/knowledge-base/third-party/how-to-install-wordpress-with-cpanel Examples of installing WordPress in subdirectories under the main domain's home directory, subdomain, or addon domain. ```text /home/example/public_html/wordpress ``` ```text /home/example/public_html/subdomain/wordpress ``` ```text /home/example/public_html/addon.com/wordpress ``` -------------------------------- ### Run the install_plugin Script Source: https://docs.cpanel.net/whm/scripts/the-install_plugin-script Execute the install_plugin script from the command line, providing the path to the plugin archive and any desired options. ```bash /usr/local/cpanel/scripts/install_plugin /filepath [options] ``` -------------------------------- ### Install Third-Party Container with Volume Mount Source: https://docs.cpanel.net/ea4/containers/the-ea-podman-script Example of installing a third-party container, mounting a local directory as a volume within the container. ```bash ea-podman install mymongo -v $HOME/myetcmongo:/etc/mongo ``` -------------------------------- ### Run the setup_greylist_db Script Source: https://docs.cpanel.net/whm/scripts/the-setup_greylist_db-script Execute the script from the command line to manage the Greylisting database. Options can be appended to perform specific actions. ```bash /usr/local/cpanel/scripts/setup_greylist_db [options] ``` -------------------------------- ### Install Valkey on Ubuntu Source: https://docs.cpanel.net/ea4/containers/valkey-via-containers Execute these commands sequentially to install the Valkey package on Ubuntu systems. ```bash apt install ea-podman-repo apt update apt install ea-valkey72 ``` -------------------------------- ### Install Third-Party Container with User Port Source: https://docs.cpanel.net/ea4/containers/the-ea-podman-script Example of installing a third-party container and setting a specific port number for use inside the container. ```bash ea-podman install mymongo --cpuser-port=8081 docker.io/library/mongo:latest ``` -------------------------------- ### Example: Process Site Templates Source: https://docs.cpanel.net/whm/scripts/the-process_site_templates-script This example demonstrates how to use the script with specific template and target paths, and defines custom values for template variables like business name, phone, and contact email. ```bash /scripts/process_site_templates --source=/var/cpanel/customizations/site_templates/my_template --target=/home/username/public_html/example.com --define business_name="National Emotion, Inc." --define phone="867-5309" --define contact="jenny@example.com" ``` -------------------------------- ### Example ignore_outdated_services File Content Source: https://docs.cpanel.net/whm/scripts/the-find_outdated_services-script This is an example of how the `/etc/cpanel/local/ignore_outdated_services` file might look after adding services to be ignored. Comments start with '#', and each service is on a new line. ```text # Prevent cPanel from checking about the cloud-init service cloud-init cloud-final ``` -------------------------------- ### Include Instance Packages Source: https://docs.cpanel.net/whm/scripts/the-snapshot_prep-script The `--instance-packages` option allows you to specify a comma-delimited list of packages to install on the first boot of instances created from an image. This is useful for packages that generate per-instance data during installation, preventing this data from being saved to the deployment image. ```bash --instance-packages=package1,package2 ``` -------------------------------- ### Example MPM Module Output Source: https://docs.cpanel.net/ea4/apache/apache-modules/apache-module-http2 This is an example of the output you might see when checking installed MPM modules. It helps identify the specific MPMs in use on your server. ```bash ea-apache24-mod_mpm_prefork-2.4.34-3.el7.cloudlinux.x86_64 ``` -------------------------------- ### Generate and Install Database Map Data Source: https://docs.cpanel.net/whm/scripts/the-rebuild_dbmap-script This command generates and installs the database map data for the 'example' cPanel user. This is the standard command to rebuild the database map. ```bash /usr/local/cpanel/scripts/rebuild_dbmap example ``` -------------------------------- ### Example Dependency Tracing Output Source: https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-fix-quotas This is an example output from tracing the package-dependency chain using 'apt-cache --installed rdepends'. It shows the 'Reverse Depends' for different kernel metapackages. ```bash root@ubuntu:~# apt-cache --installed rdepends linux-image-5.4.0-77-generic linux-image-5.4.0-77-generic Reverse Depends: linux-image-virtual root@ubuntu:~# apt-cache --installed rdepends linux-image-virtual linux-image-virtual Reverse Depends: linux-virtual linux-virtual root@ubuntu:~# apt-cache --installed rdepends linux-virtual linux-virtual Reverse Depends: ``` -------------------------------- ### Display Script Help Documentation Source: https://docs.cpanel.net/whm/scripts/the-install_tuxcare_els_php-script To view all available options and usage details for the `install_tuxcare_els_php` script, use the `--help` flag. This command should be executed as root. ```bash /usr/local/cpanel/scripts/install_tuxcare_els_php --help ``` -------------------------------- ### Example 'package is obsoleted' Error Source: https://docs.cpanel.net/knowledge-base/package-management/rpm-installation-failures This example demonstrates an RPM installation failure where the system classifies a package, such as `curl-devel`, as obsolete due to conflicts with another package, often from a third-party repository. ```bash [20130208.081257] Setting up Install Process [20130208.081257] Package curl-devel is obsoleted by libcurl-devel, trying to install libcurl-devel-7.21.7-5.el5.remi.2.x86_64 instead [20130208.081257] Package libcurl-devel-7.21.7-5.el5.remi.2.x86_64 already installed and latest version [20130208.081257] Package curl-devel is obsoleted by libcurl-devel, trying to install libcurl-devel-7.21.7-5.el5.remi.2.x86_64 instead [20130208.081257] Package libcurl-devel-7.21.7-5.el5.remi.2.x86_64 already installed and latest version [20130208.081257] Nothing to do [20130208.081258] E Sysup: Needed system RPMs were not installed: curl-devel [20130208.081258] ***** FATAL: Cannot proceed. Needed system RPMs were not installed. [20130208.081258] The Administrator will be notified to review this output when this script completes [20130208.081258] E Detected events which require user notification during updatenow. Will send iContact the log => Log closed Fri Feb 8 08:12:58 2013 [20130208.081258] E Running `/usr/local/cpanel/scripts/updatenow --upcp --log=/var/cpanel/updatelogs/update.1360329171.log` failed, exited with code 18 (signal = 0) ``` -------------------------------- ### Create and Navigate to New Directory Source: https://docs.cpanel.net/knowledge-base/accounts/how-to-rebuild-userdata-files Creates a new directory in the root directory and navigates into it. Replace 'example' with your desired directory name. ```bash mkdir /root/example && cd /root/example ``` -------------------------------- ### Get WordPress Installation Info Source: https://docs.cpanel.net/knowledge-base/cpanel-developed-plugins/wp-toolkit-command-line-interface Displays detailed information about a selected WordPress installation. Requires instance ID, main domain ID, and path. Supports JSON and raw output formats. ```APIDOC ## Get WordPress Installation Info ### Description Displays the detailed information about the selected WordPress installation. ### Method `wp-toolkit --info` ### Parameters #### Required Options - `-instance-id` (integer) - The ID of the WordPress installation. - `-main-domain-id` (integer) - The ID of the main domain. - `-path` (string) - The path to the WordPress installation. #### Optional Options - `-format` (string) - The output format. Supported values: `JSON`, `raw`. Defaults to `raw`. ### Request Example ```bash wp-toolkit --info -instance-id 1 -main-domain-id 1 -path httpdocs ``` ``` -------------------------------- ### spf_installer Script Help Option Source: https://docs.cpanel.net/whm/scripts/the-spf_installer-script Execute this command to display the help text and available options for the `spf_installer` script. ```bash /usr/local/cpanel/bin/spf_installer --help ``` -------------------------------- ### Display Help Documentation Source: https://docs.cpanel.net/whm/scripts/the-removeacct-script Use the --help option to view the script's available help documentation directly from the command line. ```bash /usr/local/cpanel/scripts/removeacct --help ``` -------------------------------- ### Example EasyApache 4 Profile JSON Source: https://docs.cpanel.net/ea4/basics/easyapache-4-create-a-profile This is an example of a custom EasyApache 4 profile in JSON format. It includes essential keys like version, name, tags, description, and the list of packages to be installed. ```json { "version":"1.2", "name":"SuperHost Profile", "tags":[ "Apache 2.4", "PHP 7.0", "tomorrow comes knocking", "..." ], "desc":"This profile will allow you to have super high density on your system", "pkgs":[ "ea-mod_xyz", "ea-php70", "ea-php71", "ea-your_frog", "..." ] } ``` -------------------------------- ### Example OpenSSL Version Output Source: https://docs.cpanel.net/knowledge-base/security/pci-compliance-and-software-versions This is an example of the output you might see when checking your installed OpenSSL package version using `rpm -qa | grep openssl`. It shows a specific version string that may be used for further investigation. ```text openssl-0.9.8e-36.el5_11 ``` -------------------------------- ### Add a User-Managed Service with an Init Script Source: https://docs.cpanel.net/knowledge-base/web-services/the-cpuser_service_manager-script-and-the-ubic-subsystem Set up a user-managed and monitored service using an LSB-compliant init script. The path to the script must be absolute. ```bash /usr/local/cpanel/scripts/cpuser_service_manager add my_psgi_app --init-script=/path/to/init.file ``` -------------------------------- ### Configure wwwacct.conf Parameters Source: https://docs.cpanel.net/installation-guide/customize-your-installation Define essential server setup parameters in the /etc/wwwacct.conf file. Ensure required parameters like ADDR, DEFMOD, HOMEDIR, LOGSTYLE, NS, NS2, and SCRIPTALIAS are set for successful account creation. ```shell ADDR 192.0.2.0 NS2 ns2.domain.tld CONTACTPAGER user@examplesms.com LOGSTYLE combined CONTACTEMAIL user@example.com HOMEMATCH home TTL 14400 NSTTL 86400 NS ns1.domain.tld ETHDEV eth0 ADDR6 HOST NS4 DEFMOD jupiter HOMEDIR /home NS3 SCRIPTALIAS y ``` ```shell ADDR 192.0.2.0 DEFMOD jupiter HOMEDIR /home LOGSTYLE combined NS ns1.domain.tld NS2 ns2.domain.tld SCRIPTALIAS y ``` -------------------------------- ### Example Flask Application Source: https://docs.cpanel.net/knowledge-base/web-services/how-to-install-a-python-wsgi-application A basic 'Hello, World!' Flask application. This serves as a starting point for a Python WSGI application. ```python from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' if __name__ == '__main__': app.run() ``` -------------------------------- ### Verify cPanel & WHM Version Source: https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-update-your-system Use this command to check the currently installed version of cPanel & WHM on your server. This is useful before starting an update process. ```bash /usr/local/cpanel/cpanel -V ``` -------------------------------- ### Display Groups (YAML) Source: https://docs.cpanel.net/manage2/api/manage2-api-display-groups This example shows how to retrieve account groups in YAML format. The `expand` parameter can be added to the URL to get more detailed group information. ```APIDOC ## GET XMLgroupInfo.cgi ### Description Retrieves a Manage2 account's groups in YAML format. ### Method GET ### Endpoint https://manage2.cpanel.net/XMLgroupInfo.cgi?output=yaml ### Query Parameters - **output** (string) - Optional - Specifies the output format. Use 'yaml' for YAML output. - **expand** (string) - Optional - Displays the `group` return with expanded details. This parameter does not accept values. ### Response Example (YAML) ```yaml --- group: - name: testgroupone groupid: G294658 - name: testgrouptwo groupid: G294662 - name: testgroupthree groupid: G294666 - name: testgroupfour groupid: G863177 version: '0.5' status: 1 reason: OK ``` ``` -------------------------------- ### Example: Sync Multiple DNSSEC Keys Source: https://docs.cpanel.net/whm/scripts/the-dnssec-cluster-keys-script This example demonstrates syncing two active DNSSEC keys for the 'example.com' zone. The script will not produce output if successful. ```bash /usr/local/cpanel/scripts/dnssec-cluster-keys --sync --zone=example.com --tag=46547 --tag=31016 ``` -------------------------------- ### Display Groups (XML) Source: https://docs.cpanel.net/manage2/api/manage2-api-display-groups This example shows how to retrieve account groups in XML format. The `expand` parameter can be added to the URL to get more detailed group information. ```APIDOC ## GET XMLgroupInfo.cgi ### Description Retrieves a Manage2 account's groups in XML format. ### Method GET ### Endpoint https://manage2.cpanel.net/XMLgroupInfo.cgi ### Query Parameters - **expand** (string) - Optional - Displays the `group` return with expanded details. This parameter does not accept values. ### Response Example (XML) ```xml ``` ``` -------------------------------- ### Initialize Greylisting Database Source: https://docs.cpanel.net/whm/scripts/the-setup_greylist_db-script Use the `--init` option to set up the basic data structure for the Greylisting SQLite database. ```bash /usr/local/cpanel/scripts/setup_greylist_db --init ``` -------------------------------- ### Display Groups (JSON) Source: https://docs.cpanel.net/manage2/api/manage2-api-display-groups This example shows how to retrieve account groups in JSON format. The `expand` parameter can be added to the URL to get more detailed group information. ```APIDOC ## GET XMLgroupInfo.cgi ### Description Retrieves a Manage2 account's groups in JSON format. ### Method GET ### Endpoint https://manage2.cpanel.net/XMLgroupInfo.cgi?output=json ### Query Parameters - **output** (string) - Optional - Specifies the output format. Use 'json' for JSON output. - **expand** (string) - Optional - Displays the `group` return with expanded details. This parameter does not accept values. ### Response Example (JSON) ```json { "group": [ { "name": "testgroupone", "groupid": "G294658" }, { "name": "testgrouptwo", "groupid": "G294662" }, { "name": "testgroupthree", "groupid": "G294666" }, { "name": "testgroupfour", "groupid": "G863177" } ], "version": "0.5", "status": 1, "reason": "OK" } ``` ``` -------------------------------- ### Configure IPv6 with Legacy Network-Scripts Source: https://docs.cpanel.net/knowledge-base/ipv6/how-to-get-started-with-ipv6 This example shows how to configure IPv6 settings in the `/etc/sysconfig/network-scripts/ifcfg-eth0` file for systems using legacy network-scripts. Ensure `NETWORKING_IPV6=yes` is present in `/etc/sysconfig/network`. ```bash IPV6INIT=yes IPV6ADDR=2001:db8:1a34:56cf::100/64 IPV6_DEFAULTGW=2001:db8:1a34:56cf::1 ```