Skip to content

WHM / cPanel

Installation

BotGuard provides a WHM / cPanel integration plugin. When the plugin is installed, the BotGuard Apache web server protection module is activated. The control panel provides the appropriate configuration options for the WHM admin and cPanel user.

The module is provided as a package for CentOS 7 and above. The module is installed and updated in the standard way, using an SSH connection to the WHM server.

Import the BotGuard package digital signature key:

rpm --import https://repo.botguard.net/botguard.gpg
Add the BotGuard repository to the system repositories:
yum-config-manager --add-repo https://repo.botguard.net/BotGuard.repo
Clear the packages cache:
yum clean all
Install the BotGuard WHM / cPanel plugin:
yum install --disablerepo botguard --enablerepo botguard-cloudlinux ea-apache24-botguard-mod_ssl ea-apache24-mod_botguard
yum install botguard-whm
BotGuard module for EasyApache will also be installed as a dependency — ea-apache24-mod_botguard. Restart your Apache Server:
/usr/local/cpanel/scripts/restartsrv_httpd

Nginx support in WHM / cPanel (optional)

The WHM / cPanel website control panel uses Apache as the web server. Some users prefer to use Nginx web server instead of Apache, which is not included in the standard configuration of the control panel. It is generally recommended to use Engintron for this task, which is an open source project.

BotGuard integration plugin supports Engintron. To integrate the plugin with Engintron additional steps need to be taken after installing the BotGuard plugin:

  1. Install the BotGuard module for Nginx according to the instructions.

  2. Disable Apache BotGuard module. To do this, in the file /etc/apache2/conf.modules.d/10-botguard.conf comment out the line loading the module (add a # symbol at the beginning of the line), so that it looks as follows:

    # LoadModule botguard_module modules/mod_botguard.so
    
    Restart your Apache web server:
    /usr/local/cpanel/scripts/restartsrv_httpd
    

  3. Remove the cron job for Engintron. To do this, in the file /etc/crontab comment out the appropriate line. It should look like this:
    # * * * * * root /etc/nginx/utilities/https_vhosts.sh >> /dev/null 2>&1
    
    Restart the cron scheduler:
    systemctl restart crond
    
    End any Engintron tasks that may have remained running:
    killall -9 https_vhosts.sh
    
  4. At the start of the /etc/nginx/nginx.conf file, add a line to load the BotGuard module for Nginx
    include /usr/share/nginx/modules/mod-botguard.conf;
    
    and restart the Nginx web server:
    systemctl restart nginx
    
  5. Make sure the system time is in sync with the precision time servers:
    yum install chrony
    timedatectl set-ntp true
    
  6. Start the service to sync Apache and Nginx configuration files:
    chkconfig engintron-sync on
    service engintron-sync restart
    

Configuration

The plugin will be disabled after installation. Before using the plugin, it must be pre-configured. To configure the plugin, open the WHM web control panel and go to section Home » Plugins » BotGuard Bot Management: whm-step1.png

Next, in the plugin parameters page, fill in your API key and assigned BotGuard servers and press the Apply button: whm-step2.png

You can get an API Key in your account details at botguard.net. Fill in the fields of Primary and Secondary Servers with the addresses of BotGuard servers assigned to your account.

After installing the plugin, each user of this WHM server will gain access to the website protection settings and the corresponding menu section in the cPanel web control panel: whm-step3.png

In the BotGuard Bot Management section, сPanel users can enable or disable protection for their websites: whm-step4.png

After enabling protection, a cPanel user can view traffic details and configure the bot traffic management rules: whm-step5.png