0

I am running an Windows Server 2008 R2 Enterprise with an Apache Server installed and mod_perl & mod_ssl I just installed Apache2::ModSSL, but i was not able to use cpan for this and had to compile it using nmake. CPAN is not working correctly on this Server and i am not able to change this. A perl script called via https should later be able to Access the certificate the Clients used to authenticate, thats why i want to use Apache2::ModSSL to Access the SSL variables.

When i try to acess my test script after implementing

use Apache2::ModSSL;

i get an HTTP500 error from the Server. The Servers error log states

[Fri Jul 01 15:01:58 2016] [error] [client 10.217.139.184] failed to resolve handler `ssl::hello': Can't load 'C:/Apache/Perl/site/lib/auto/Apache2/ModSSL/ModSSL.dll' for module Apache2::ModSSL: load_file:The specified module could not be found at C:/Apache/Perl/lib/XSLoader.pm line 68.\n at C:/Apache/Perl/site/lib/Apache2/ModSSL.pm line 8\nCompilation failed in require at ssl/hello.pm line 7.\nBEGIN failed--compilation aborted at ssl/hello.pm line 7.\nCompilation failed in require at (eval 3) line 3.\n

When i check the file Location, ModSSL.dll is stored at exact this path. I also checked the file Access and granted Full acess to All Users, System, Administrators etc. Apache was restarted multiple times and it did not Change anything. When i tried to execute it in a cmd, obviously there was no Connection to check but i could execute

use Apache2::ModSSL;
print Apache2::ModSSL->VERSION;

without Problems. How to solve the issue with loading the module within Apache?

Server readme states

This is a binary distribution for Win32 of Perl 5.8.7 and Apache 2.0.54, together with mod_perl-2.0.1, mod_ssl / OpenSSL (0.9.7g), and php-4.3.11, all built with VC++ 6.0 (SP5).

cl -version states

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86

nmake -version states

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
chenino
  • 454
  • 2
  • 7
  • 19
  • Your `perl` and XS modules have to be compiled with the same compiler. – Sinan Ünür Jul 01 '16 at 13:23
  • As a readme file states, the Apache Server and Perl where built using VC++ 6.0 (SP5). So nmake should be the same Compiler, or am i wrong? – chenino Jul 01 '16 at 13:25
  • Well, is that compiler installed? Did you check which `nmake` is being invoked? What does `cl` give you as version number? You are the only person who can know these things, so update your question with the information. – Sinan Ünür Jul 01 '16 at 13:32
  • Updated with the Information you whished. But even if those might be a never build, is this really the core Problem ? This sounded more like a Environment variable problem to me, even if i am not this experienced in this – chenino Jul 01 '16 at 13:42
  • Just a question, can this really be the Problem when i can load the module within a command line but not within the Apache? Just for my understanding as i am no expert in this. Regarding the Server : it is just used internal and not accessible public. I agree on the safety concerns, but think they are not the main issue as long as this is not going external – chenino Jul 01 '16 at 14:09

1 Answers1

2

Without investigating too deeply, the most likely reason for your problem is that perl, OpenSSL, mod_ssl etc where compiled with a different compiler than the one you used to build Apache::ModSSL.

It seems to me that the module only tries the XS version if it thinks it's running under mod_perl. You can see this in the module's Apache2/ModSSL.pm:

XSLoader::load __PACKAGE__, $VERSION
  if( exists $ENV{MOD_PERL} and $ENV{MOD_PERL}=~/mod_perl/ );

It only tries to load the XS component if the MOD_PERL environment variable exists and it contains mod_perl. My guess is if you did:

C:\> set MOD_PERL=mod_perl
C:\> perl -MApache2::ModSSL -e "print $Apache2::ModSSL::VERSION"

you would encounter problems.

In addition, I feel I must emphasize the facts that your OpenSSL version in addition to perl and php seem too old to be used safely.

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
  • 1
    Sorry for the delay in my Response. I tried it with your commands and got a more differntiated error message that MSCVR90.dll is missing. I am trying now to integrate it into the path and will try it then again. This takes me one step further, so it was already helpful. When i am done with trying this, i will mark your answer – chenino Jul 01 '16 at 15:13