Help CWAF is not working anymore after upgrade from Ubuntu

Hello,

After upgrading from Ubuntu 12.04 LTS to 14.04 LTS CWAF is not working anymore.

When I run CWAF in WEBMIIN the following error happens:

Error - Perl execution failed

Can’t locate Comodo/CWAF/Main.pm in @INC (you may need to install the Comodo::CWAF::Main module) (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl . /usr/share/webmin/ …) at /usr/share/webmin/cwaf/index.cgi line 14.
BEGIN failed–compilation aborted at /usr/share/webmin/cwaf/index.cgi line 14.

I tried to reinstall CWAF but also got errors.

sh cwaf_client_install.sh
Verifying archive integrity… All good.
Uncompressing Comodo WAF Client Installer v2.13…


Checking pre-requisites

BASH bin OK (/bin/bash)
CPAN bin OK (/usr/bin/cpan)
GCC bin OK (/usr/bin/gcc)
MAKE bin OK (/usr/bin/make)
STRINGS bin OK (/usr/bin/strings)

Running installer

tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
expr: syntax error
expr: syntax error

cannot open tty-output

Thanks in advance for your help!!

Hi

Seems Perl path was changed in 14.04

Two solution is available:

  • Symlink from old CWAF modules install
    (can be located with “locate CWAF.pm” shell command) to new path (for examlpe to /usr/local/share/perl/5.18.2)

Lets assume locate found file at path: /usr/local/share/perl5/Comodo/CWAF.pm
so symlik will be:

ln -s /usr/local/share/perl5/Comodo /usr/local/share/perl/5.18.2/Comodo
  • Reinstall from root console:

HOME=/root TERM=xterm bash ./cwaf_client_install.sh

Regards, Oleg

HI Oleg,

Good to see you again and thanks already so much for your help

I only have some trouble with it.

I performed this command:

locate CWAF.pm

/usr/local/cwaf/modules/CPAN/blib/lib/Comodo/CWAF.pm
/usr/local/cwaf/modules/CPAN/lib/Comodo/CWAF.pm
/usr/local/share/perl/5.14.2/Comodo/CWAF.pm

What is the next step Oleg?
I hope we get it up and running again :slight_smile:

Regards
Allard

Hi

I think this command should fix CWAF:

# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/local/share/perl/5.18.2/Comodo

Regards, Oleg

Hi Oleg,

I tried but get this error:

ln -s /usr/local/share/perl/5.14.2/Comodo /usr/local/share/perl/5.18.2/Comodo

ln: failed to create symbolic link ‘/usr/local/share/perl/5.18.2/Comodo’: No such file or directory

Do you have another idea?

Regards
Allard

Hello Oleg,

I checked it also by looking in the server and the folder 5.18.2 is indeed not there.

How can we fix this Oleg? I hope it does not happen with everyone. Upgrading from Ubuntu 12.04 to 14.04 caused several problems. I hope you have a solution to get CWAF running again because the website is not protected anymore :frowning:

Thanks in advance Oleg!!

Regards
Allard

Hi

Sorry for delay. I was sure path 5.18.2 is exists because it in Perl INC path.
So we can either create 5.18.2 path before symlinking:

# mkdir -p /usr/local/share/perl/5.18.2
# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/local/share/perl/5.18.2/Comodo

Or use any other existing path from Perl INC.
We can get INC paths from Perl error code:

(INC contains: /usr/share/webmin /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl . /usr/share/webmin/ …) at /usr/share/webmin/cwaf/index.cgi line 14.

Please try these commands and stop after first success. Single simlink will be enough :slight_smile:

# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/local/lib/perl/5.18.2/Comodo
# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/lib/perl5/Comodo
# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/share/perl5/Comodo 
# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/lib/perl/5.18/Comodo 
# ln -s /usr/local/share/perl/5.14.2/Comodo /usr/share/perl/5.18/Comodo

Regards, Oleg

Hi Oleg,

Thanks for the fantastic help!!!

I am only afraid it is not done yet, because after succesfully have done what you wrote, I see now other errors.

Error - Perl execution failed

Can’t locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl . /usr/share/webmin/ …) at /usr/local/share/perl/5.18.2/Comodo/CWAF/ClientAPI.pm line 10.
BEGIN failed–compilation aborted at /usr/local/share/perl/5.18.2/Comodo/CWAF/ClientAPI.pm line 10.
Compilation failed in require at /usr/share/webmin/cwaf/index.cgi line 15.
BEGIN failed–compilation aborted at /usr/share/webmin/cwaf/index.cgi line 15.

I installed then:
sudo cpan JSON
an that was done with success and without errors

But new errors:
Error - Perl execution failed

Can’t locate Template.pm in @INC (you may need to install the Template module) (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl . /usr/share/webmin/ …) at /usr/local/cwaf/web/cwaf_sharedlib.pl line 4.
BEGIN failed–compilation aborted at /usr/local/cwaf/web/cwaf_sharedlib.pl line 4.
Compilation failed in require at /usr/share/webmin/cwaf/index.cgi line 21.

Then I upgraded perl to see if it helped:
$ sudo cpan
cpan[1]> upgrade
Took a long time but no difference

The same error when I start Comodo Waf in Webmin

Hope you have a fix!

Thanks!!!
Regards
Allard

Hi Oleg,

GOOD news! :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:

I opened a CPAN shell and installed Template.

Now I see the Webminmodule opens CWAF
Looks working perfect now!

THANKS SO MUCH Oleg! You are an amazing engineer! The best!!! :-TU :-TU

Regards
Allard

Hi allard

Glad to hear all works :slight_smile:
I think it’s shame Ubuntu not upgraded Perl modules with system upgrade :slight_smile:

Regards, Oleg

Hi Oleg,

Yes you are very right. It is a shame but the whole server was with errors after the upgrade to 14.04.
A fresh install was the best solution but anyway, I am happy it works again thanks to you!!!

Have a great day Oleg!

Regards
Allard