Cpanel Comodo WAF error 500 Internal Server Error Can't locate apache.pm

WHM Version 84.0.4

ERROR:
Can’t locate Cpanel/AdvConfig/apache.pm in @INC (you may need to install the Cpanel::AdvConfig::apache module) (@INC contains: /usr/local/cpanel /var/cpanel/cwaf/modules/CPAN/lib /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0 /opt/cpanel/perl5/528/site_lib/x86_64-linux-64int /opt/cpanel/perl5/528/site_lib) at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CWAF/Cpanel.pm line 15.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CWAF/Cpanel.pm line 15.
Compilation failed in require at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0/if.pm line 15.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CWAF/Platform.pm line 16.
Compilation failed in require at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CWAF/ClientAPI.pm line 17.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CWAF/ClientAPI.pm line 17.
Compilation failed in require at /var/cpanel/cwaf/scripts/updater.pl line 12.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/scripts/updater.pl line 12.

Following is from cpanel support team explaining the reason for the issue…
Thank you for your time and patience while I gathered more information for you.

At this time, I was reviewing this issue and it seems to me that this is related to something that was already observed by one of my teammates.

In short, CWAF appears to depend on cPanel’s Apache distiller system, which was intentionally removed in version 84. This update is shown below in your cPanel Change Logs.

“Fixed case CPANEL-28581: Remove the apache conf distiller system.”

You can see the cases that have been integrated into cPanel at https://documentation.cpanel.net/display/CL/84+Change+Log

The Apache distiller is an system that was leftover from EasyApache3, and has reached end of life. Comodo themselves must update their plugin so that it does not rely on the old Apache Distiller.

However, based on some other information I could find, most users just prefer to manually install the Comodo WAF Mod_sec rules manually. I believe you might have already done this as well.

I was reviewing some of the information shown on the forums post here https://forums.cpanel.net/threads/comodo-waf-broken-after-ea3-to-ea4-update.602271/ - Even thought the forums thread itself is a little old, the information in the thread is still very much relevant.

I do apologize for any inconvenience, but I do hope that this is helpful. Please let me know if you require anything else.

Best regards

Here is How to fix this issue
SSH to your server and go to /var/cpanel/cwaf/tmp/
cd /var/cpanel/cwaf/tmp/
mkdir install
cd install
wget https://waf.comodo.com/cpanel/cwaf_client_install.sh
bash /var/cpanel/cwaf/tmp/install/cwaf_client_install.sh – --update --mode cpanel
cd …
rm -rf install
cd /var/cpanel/cwaf/scripts
./updater.pl
./update-client.pl

After all of these commands successfully issued, go check your CWAF plugin. it should be already updated to the latest version with rulesets and no more error.

Good Luck…

i have this error

[root@masterhost scripts]# ./updater.pl
Can’t locate Cpanel/AdvConfig/apache.pm in @INC (you may need to install the Cpa nel::AdvConfig::apache module) (@INC contains: /usr/local/cpanel /var/cpanel/cwa f/modules/CPAN/lib /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_ 64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib /usr/loc al/cpanel/3rdparty/perl/528/lib/perl5/5.28.0/x86_64-linux-64int /usr/local/cpane l/3rdparty/perl/528/lib/perl5/5.28.0 /opt/cpanel/perl5/528/site_lib/x86_64-linux -64int /opt/cpanel/perl5/528/site_lib) at /var/cpanel/cwaf/modules/CPAN/lib/Como do/CWAF/Cpanel.pm line 15.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CW AF/Cpanel.pm line 15.
Compilation failed in require at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5 .28.0/if.pm line 15.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CW AF/Platform.pm line 16.
Compilation failed in require at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CWAF/C lientAPI.pm line 17.
BEGIN failed–compilation aborted at /var/cpanel/cwaf/modules/CPAN/lib/Comodo/CW AF/ClientAPI.pm line 17.
Compilation failed in require at ./updater.pl line 12.
BEGIN failed–compilation aborted at ./updater.pl line 12.

Hi,
When you are in terminal, instead doing of this
[root[at]masterhost scripts]# ./updater.pl

issue these

[root[at]masterhost scripts]# cd /var/cpanel/cwaf/tmp/
[root[at]masterhost tmp]# mkdir install
[root[at]masterhost tmp]# cd install
[root[at]masterhost install]# wget https://waf.comodo.com/cpanel/cwaf_client_install.sh
[root[at]masterhost install]# bash /var/cpanel/cwaf/tmp/install/cwaf_client_install.sh – --update --mode cpanel
[root[at]masterhost install]# cd …
[root[at]masterhost tmp]# rm -rf install
[root[at]masterhost tmp]# cd /var/cpanel/cwaf/scripts
[root[at]masterhost scripts]# ./updater.pl
[root[at]masterhost scripts]# ./update-client.pl

It will fix the errors you are getting. You only issue the commands above not the [root[at]masterhost xxx]# part.
Good Luck

@ckeeper – I just want to thank you for posting your very clear instructions in above. I just discovered this error on my server today (no idea how long it has been there - the system is currently running WHM 84.0.15 ).

I was able to find your post here very quickly and your very detailed and clear instructions allowed me to restore full function very quickly.

Same problem and no fix still :frowning:

Hi,
the issue is currently in the developers’ backlog and no ETA so far.
We suggest reinstalling plugin in standalone mode.

Can you please provde exact steps for standalone installation?