Apache LoadModule addition causing Apache to not start
Posted by: skiglades (---.static.mammoth-mtn.com)
Date: June 10, 2013 11:51PM

Hi,
I'm installing the ModSecurity Apache module but noticed that when a "LoadModule ... " statement is added to httpd.conf, Apache fails to start with the error:

"C:\wamp\bin\apache\apache2.4.2\bin>httpd.exe
httpd.exe: Syntax error on line 150 of C:/wamp/bin/apache/apache2.4.2/conf/httpd
.conf: Cannot load C:/wamp/bin/apache/apache2.4.2/modules/mod_security2.so into
server: The specified procedure could not be found."

If I comment out that line, Apache starts just fine. I don't believe this is an Apache issue as all the guides on this I've seen are straightforward and recommend the install procedure below....


The directions for installing ModSecurity are simple enough:
# Install:
- Copy mod_security2.so to your modules folder

# Add to your httpd.conf:
- LoadModule security2_module modules/mod_security2.so
- Enable the module unique_id by uncommenting:
LoadModule unique_id_module modules/mod_unique_id.so


Could there be something in WAMP that needs to be done to load additional modules? Thanks!


My build...
Apache 2.4.2 – Mysql 5.5.24 – PHP 5.4.3 XDebug 2.1.2 XDC 1.5 PhpMyadmin 3.4.10.1 SQLBuddy 1.3.3 webGrind 1.0

Options: ReplyQuote
Re: Apache LoadModule addition causing Apache to not start
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: June 11, 2013 10:03AM

Are you sure you got a module that is compatible with Apache you are using?

I assume by the version of Apache you have, you are using the 64 bit WAMP and Apache. Are you sure you downloaded 64bit modules?? Is it compatible with code compiled with VC9?

IF not try here [www.apachelounge.com]

Options: ReplyQuote
Re: Apache LoadModule addition causing Apache to not start
Posted by: skiglades (---.static.mammoth-mtn.com)
Date: June 11, 2013 04:40PM

Thanks, RiggsFolly.

I pulled modsecurity from Apache Lounge for the 64-bit versions of WAMP/Apache I'm using. (http://www.apachelounge.com/download/win64/modules-2.4/mod_security-2.7.4-win64.zip)

For fun I pulled down the 32-bit version of modsec and got the same issue with Apache not starting.


When I hover over the modsecurity folder, the tool tip states "Build with VC10" ... That seems to not be the issue as the notes from Apache Lounge state "Modules below are build VC10 and loads when Apache 2.4 Win64 is build with x64 VC9, VC10 or VC11"

The Visual C++ 2010 SP1 Redistributable Package x64 is recommended in the ModSec readme. My Add/Remove Programs lists the package as: "Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219" but makes no mention of "SP1" so I'm going to check into that now...

Thanks so far....

Options: ReplyQuote
Re: Apache LoadModule addition causing Apache to not start
Posted by: skiglades (---.static.mammoth-mtn.com)
Date: June 11, 2013 04:48PM

... verified the Visual C++ 2010 SP1 Redistributable Package x64 is installed.

Options: ReplyQuote
Re: Apache LoadModule addition causing Apache to not start
Posted by: RiggsFolly (---.as13285.net)
Date: June 11, 2013 06:15PM

Does that mean it now works?

Options: ReplyQuote
Re: Apache LoadModule addition causing Apache to not start
Posted by: skiglades (---.static.mammoth-mtn.com)
Date: June 11, 2013 06:23PM

Unfortunately, no. I just verified I had the correct VC++ installed. Apache is still not starting with the same error.

Options: ReplyQuote
Re: Apache LoadModule addition causing Apache to not start
Posted by: skiglades (---.static.mammoth-mtn.com)
Date: June 11, 2013 08:26PM

Here's the fix.

Thanks to Steffen over at [www.apachelounge.com] I replaced WAMP's (Apache's) default "libxml2.dll" and "pcre.dll" files with ones I downloaded from the Apache 2.4.4 64bit build (http://www.apachelounge.com/download/win64/binaries/httpd-2.4.4-win64.zip)

I renamed the original .dll's to "libxml2-backup.dll" and "pcre-backup.dll" to retain them just in case. I then pulled the libxml2 and pcre .dll's from the extracted zip (above) and copied them into the same directory (...\apache2.4.2\bin)

Apache started without issue, with the ModSecurity LoadModule string.

Here's the related forum post on this: [www.apachelounge.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.