Author Topic: Comodo WAF for DirectAdmin  (Read 27028 times)

Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #60 on: December 22, 2015, 11:50:05 AM »
Thank you for feedback.

I have checked source code and found it can't detect Apache version.
Can you please send me output of command
Code: [Select]
# apachectl -vfor 'faulty' server.

Thanks in advance

Regards, Oleg

Offline Invader Zim

  • Newbie
  • *
  • Posts: 8
Re: Comodo WAF for DirectAdmin
« Reply #61 on: December 24, 2015, 04:38:30 AM »
 # apachectl -v
Server version: Apache/2.4.18 (Unix)
Server built:   Dec 19 2015 00:00:30

We upgraded to latest versions and also installed cwaf. We though that might be a good idea.

Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #62 on: December 25, 2015, 02:08:46 AM »
Hi

I have checked string you kindly provided with my 'parse Apache version' code and it works.
Is this error still continue to appear on updated server?

Thank you.

Regards, Oleg

Offline Invader Zim

  • Newbie
  • *
  • Posts: 8
Re: Comodo WAF for DirectAdmin
« Reply #63 on: December 25, 2015, 04:08:09 AM »
The problem is not with apache, but probably with perl. All our servers are running the latest apache version, some work, some give the mentioned error.

Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #64 on: December 28, 2015, 04:16:07 AM »
Hi

I have rewrote Apache version check part for DirectAdmin.
It will be fixed in next release of client.
If you want to try fix before release please edit file /usr/local/cwaf/modules/CPAN/lib/Comodo/CWAF/DAdmin.pm (do not forget to save backup copy :) )
Line 87 contained following code:
Code: [Select]
        $var =~ /(Server version.+)(\/)([0-9.]+)(.*)/;
        $tmp{'httpd_version'} = $3;
Please add following 8 lines after this line, so it will look like this (replace [at] with 'commercial at' sign):
Code: [Select]
        $var =~ /(Server version.+)(\/)([0-9.]+)(.*)/;
        $tmp{'httpd_version'} = $3;
        # can't get version due regex issue
        unless($tmp{'httpd_version'}) {
          my [at]sver = split(' ', $var);
          if ($sver[2] =~ /Apache.+/) {
           my [at]ver_str = split('/', $sver[2]);
           $tmp{'httpd_version'} = $ver_str[1];
          }
        }

Save file and perform modules update.
Code: [Select]
# cd /usr/local/cwaf/modules/CPAN
# perl Makefile.PL
# make install

To return changes back restore /usr/local/cwaf/modules/CPAN/lib/Comodo/CWAF/DAdmin.pm and perform modules update again.

Offline Invader Zim

  • Newbie
  • *
  • Posts: 8
Re: Comodo WAF for DirectAdmin
« Reply #65 on: December 28, 2015, 04:52:12 AM »
That did not have the expected result.

Code: [Select]
Bareword found where operator expected at /usr/local/lib/perl5/site_perl/Comodo/CWAF/DAdmin.pm line 91, near "]sver"
(Missing operator before sver?)
Bareword found where operator expected at /usr/local/lib/perl5/site_perl/Comodo/CWAF/DAdmin.pm line 93, near "]ver_str"
(Missing operator before ver_str?)
syntax error at /usr/local/lib/perl5/site_perl/Comodo/CWAF/DAdmin.pm line 91, near "my ["
syntax error at /usr/local/lib/perl5/site_perl/Comodo/CWAF/DAdmin.pm line 93, near "my ["
Compilation failed in require at /usr/local/lib/perl5/5.20/if.pm line 15.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/Comodo/CWAF/Platform.pm line 18.
Compilation failed in require at /usr/local/lib/perl5/site_perl/Comodo/CWAF/ClientAPI.pm line 17.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/Comodo/CWAF/ClientAPI.pm line 17.
Compilation failed in require at /usr/local/directadmin/plugins/comodo_waf/admin/index.pl line 11.
BEGIN failed--compilation aborted at /usr/local/directadmin/plugins/comodo_waf/admin/index.pl line 11.

I don't know if it's relevant but we are using FreeBSD 10.2, not a linux variant.

Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #66 on: December 28, 2015, 06:35:58 AM »
Hi

You forgot to replace '[at]' with 'commercial at' sign (https://en.wikipedia.org/wiki/At_sign:)
It replaced by [at] on forum for security reason

Regards, Oleg

Offline Invader Zim

  • Newbie
  • *
  • Posts: 8
Re: Comodo WAF for DirectAdmin
« Reply #67 on: December 28, 2015, 07:05:09 AM »
Quite right. I fixed it and now we get

Use of uninitialized value $tmp{"httpd_version"} in split at /usr/local/lib/perl5/site_perl/Comodo/CWAF/DAdmin.pm line 99.

Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #68 on: December 28, 2015, 07:58:31 AM »
Hi

Seems nothing changed. Fix not fixed anything.
Can you please give me access to one of 'bad' server so I can check what wrong on site.

Please write PM, on create ticket (https://support.comodo.com/index.php?/Tickets/Submit  'WAF department')

Regards, Oleg

Offline oporowiec

  • Newbie
  • *
  • Posts: 1
Re: Comodo WAF for DirectAdmin
« Reply #69 on: December 31, 2015, 09:11:41 PM »
Debian Jessie (8) with DirectAdmin i have after upgrade:

Can't locate Comodo/CWAF/Main.pm in [at]INC (you may need to install the Comodo::CWAF::Main module) ([at]INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/local/directadmin/plugins/comodo_waf/admin/index.pl line 10.
BEGIN failed--compilation aborted at /usr/local/directadmin/plugins/comodo_waf/admin/index.pl line 10.

What to do to solve this?


Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #70 on: January 01, 2016, 08:08:29 AM »
Seems Jessie not saved previous Perl modules during upgrade.

Please try:
Code: [Select]
# ln -s /usr/local/cwaf/modules/CPAN/lib/Comodo /usr/share/perl5/Comodo
Or reinstall CWAF.
Code: [Select]
# wget -O cwaf_client_install.sh https://waf.comodo.com/cpanel/cwaf_client_install.sh
# bash ./cwaf_client_install.sh -- --update


Regards, Oleg
« Last Edit: January 01, 2016, 08:18:48 AM by oleg.tsygany »

Offline dutchprogrammer

  • Newbie
  • *
  • Posts: 2
Re: Comodo WAF for DirectAdmin
« Reply #71 on: February 06, 2016, 06:58:54 AM »
I had the same error as jessie but after making the symlink i get another error:
Can't locate JSON.pm in [at]INC ([at]INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/Comodo/CWAF/ClientAPI.pm line 10.
BEGIN failed--compilation aborted at /usr/share/perl5/Comodo/CWAF/ClientAPI.pm line 10.
Compilation failed in require at /usr/local/directadmin/plugins/comodo_waf/admin/index.pl line 11.
BEGIN failed--compilation aborted at /usr/local/directadmin/plugins/comodo_waf/admin/index.pl line 11.

The above dont get fixed after the update line.

I already installed Comodo WAF on 4 other server without problems but only this server keeps gettings problems.

How can i fix this ?
---------

Above message has been fixed by installing perl-json:
yum install perl-JSON


now i get the next error:
Can't locate Template.pm in [at]INC ([at]INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 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/local/directadmin/plugins/comodo_waf/admin/index.pl line 15.



Seems Jessie not saved previous Perl modules during upgrade.

Please try:
Code: [Select]
# ln -s /usr/local/cwaf/modules/CPAN/lib/Comodo /usr/share/perl5/Comodo
Or reinstall CWAF.
Code: [Select]
# wget -O cwaf_client_install.sh https://waf.comodo.com/cpanel/cwaf_client_install.sh
# bash ./cwaf_client_install.sh -- --update


Regards, Oleg
« Last Edit: February 06, 2016, 07:04:43 AM by dutchprogrammer »

Offline akabakov

  • Comodo's Hero
  • *****
  • Posts: 375
Re: Comodo WAF for DirectAdmin
« Reply #72 on: February 06, 2016, 04:05:50 PM »
Please, send the ticket at (https://support.comodo.com/index.php?/Tickets/Submit  'WAF department'). May be I need a shell to your server because of specific issue.

Offline oleg.tsygany

  • Comodo's Hero
  • *****
  • Posts: 279
Re: Comodo WAF for DirectAdmin
« Reply #73 on: February 08, 2016, 02:07:20 AM »
Above message has been fixed by installing perl-json:
yum install perl-JSON

now i get the next error:
Can't locate Template.pm in [at]INC ([at]INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 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/local/directadmin/plugins/comodo_waf/admin/index.pl line 15.

Hi

Try to install perl Template:
Code: [Select]
#yum install perl-Template-Toolkit
Also other perl modules may required.

Regards, Oleg
« Last Edit: February 08, 2016, 02:10:12 AM by oleg.tsygany »

Offline dutchprogrammer

  • Newbie
  • *
  • Posts: 2
Re: Comodo WAF for DirectAdmin
« Reply #74 on: February 08, 2016, 03:05:36 AM »
Hi

Try to install perl Template:
Code: [Select]
#yum install perl-Template-Toolkit
Also other perl modules may required.

Regards, Oleg


Thanks, this fixed the error on the frontend but now i get an error in the backend (ajax request)

XML Parsing Error: no element found Location: moz-nullprincipal:{ec9eb987-d122-48ce-9629-8bf2175b4426} Line Number 1, Column 1:
XML Parsing Error: no element found Location: moz-nullprincipal:{1003202c-1c6b-4b74-b005-81b87bc03230} Line Number 1, Column 1:


After some debugging i found out that the error was caused by the missing perl module xaml syck to
yum install perl-YAML-Syck


After this error its working correctly
« Last Edit: March 17, 2016, 05:22:19 PM by dutchprogrammer »

 

Free Endpoint Protection
Seo4Smf 2.0 © SmfMod.Com Smf Destek