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
# apachectl -v
for ‘faulty’ server.
Thanks in advance
Regards, Oleg
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
# apachectl -v
for ‘faulty’ server.
Thanks in advance
Regards, Oleg
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.
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
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.
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:
$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):
$var =~ /(Server version.+)(\/)([0-9.]+)(.*)/;
$tmp{'httpd_version'} = $3;
# can't get version due regex issue
unless($tmp{'httpd_version'}) {
my @sver = split(' ', $var);
if ($sver[2] =~ /Apache.+/) {
my @ver_str = split('/', $sver[2]);
$tmp{'httpd_version'} = $ver_str[1];
}
}
Save file and perform modules update.
# 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.
That did not have the expected result.
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.
Hi
You forgot to replace ‘[at]’ with ‘commercial at’ sign (At sign - Wikipedia)
It replaced by [at] on forum for security reason
Regards, Oleg
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.
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 (Submit a ticket - Powered by Kayako Help Desk Software ‘WAF department’)
Regards, Oleg
Debian Jessie (8) with DirectAdmin i have after upgrade:
Can’t locate Comodo/CWAF/Main.pm in @INC (you may need to install the Comodo::CWAF::Main module) (@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?
Seems Jessie not saved previous Perl modules during upgrade.
Please try:
# ln -s /usr/local/cwaf/modules/CPAN/lib/Comodo /usr/share/perl5/Comodo
Or reinstall CWAF.
# wget -O cwaf_client_install.sh https://waf.comodo.com/cpanel/cwaf_client_install.sh
# bash ./cwaf_client_install.sh -- --update
Regards, Oleg
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.
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 @INC (@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.
Please, send the ticket at (Submit a ticket - Powered by Kayako Help Desk Software ‘WAF department’). May be I need a shell to your server because of specific issue.
Hi
Try to install perl Template:
#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
Hi
it’s possible that every customer (Directadmin) can exclude the rules on their website ?
Thanks
Yes it possible to achieve this by adding mod_security directives (SecRuleRemoveById) to VirtualHost container for customers.
The most promising file to add this directives is /usr/local/directadmin/data/users//httpd.conf
But after adding directives Apache/Nginx reload required so site admin should be involved anyway.
Hi!
ok but you do not think soon built a user interface ?
Thanks
I’m afraid no.
We’re busy with other product - cWatch Web which have such feature (website customers can add rules to exclude list).
But this functionality available for cPanel hosts only yet.
What is the difference between cWatch and CWAF?
And is there a way to test/trial cWatch?