How to activate HTTP/2 for Apache through WHM and CMD

July 14, 2025 / cPanel & WHM

In this article, we will delve into the process of activating HTTP/2 for Apache through WHM and the command line.

Let us discuss the two methods for activating HTTP/2:

Method 1:
The graphical user interface makes it easy to activate HTTP/2 if you are using WHM with EasyApache 4.

  1. Log in to WHM using root credentials.
  2. Choose the “Software” section and click on the “EasyApache 4” sub-option.
    EasyApache4
  3. Click on the “Customise” button.
    customise
  4. Select the “Apache Modules” section.
  5. Search for the “mod_http2” module.
  6. Check the box to enable HTTP2.
    apache modules
  7. If prompted with a warning, click “Yes” to confirm.
    yes
  8. Go to the “Review” tab.
    review
  9. Click the “Provision” button to apply changes.
    provision
  10. Wait for EasyApache to complete the build process.
  11. “Restart” Apache to apply the HTTP/2 configuration.
    restart

Method 2:
If you are handling Apache directly on a Linux server without WHM, you will need to switch your Apache Multi-Processing Module (MPM) to one compatible with HTTP/2, such as “mod_mpm_event.” This method is suitable for advanced or CLI-based setups.

  1. Access the server by logging in as the root user.
  2. Check the currently installed MPM module to determine which one is active. Execute one of the following commands depending on your system:
    httpd -M | grep mpm

    Or, if apache2ctl is available:

    apache2ctl -M | grep mpm

    Look for output such as “mpm_prefork_module”, “mpm_itk_module,” or other MPM modules.

  3. Uninstall the incompatible MPM modules using the “yum” package manager. This is necessary because modules like “prefork” and “itk” are not well-suited with HTTP/2.
    Run the following commands:

    yum remove ea-apache24-mod_mpm_prefork
    yum remove ea-apache24-mod_mpm_itk

    Confirm the removal when prompted by typing “y” and pressing Enter.

  4. Now, install the required modules for HTTP/2 support:
    yum install ea-apache24-mod_mpm_event ea-apache24-mod_http2

    This ensures Apache uses the event MPM and loads the “mod_http2” module.

  5. To implement the changes, “Restart” Apache with the following command:
    systemctl restart httpd

By following this simple guide, you will successfully replace unsuitable MPM modules, activate HTTP/2, and expand your server for better performance. Hope you liked the two methods of activating HTTP/2 for Apache through WHM and CMD. If you still find issues in your hosting experience, feel free to contact our 24/7 technical support team.

Managing databases too? Learn How to activate a MySQL Profile in WHM

Spread the love