LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-11-2008, 04:18 PM   #1
olddocks
LQ Newbie
 
Registered: Dec 2006
Posts: 23

Rep: Reputation: 15
mod_security compile problem?


i have a linux vps (apache 1.3) with centos 4.6 and i downloaded mod_security_1.9.5 and when i used this command
Quote:
apxs -cia mod_security.c
i am getting lots of errors and warning like

Code:
mod_security.c:32:20: ap_md5.h: No such file or directory
mod_security.c:73: error: syntax error before "security_module"
mod_security.c:73: warning: data definition has no type or storage class
mod_security.c:445: error: syntax error before "array_header"
mod_security.c:445: warning: no semicolon at end of struct or union
mod_security.c:460: error: syntax error before '}' token
mod_security.c:470: error: syntax error before "array_header"
mod_security.c:470: warning: no semicolon at end of struct or union
mod_security.c:525: error: syntax error before '*' token
mod_security.c:525: warning: data definition has no type or storage class
mod_security.c:536: error: syntax error before '*' token
mod_security.c:536: warning: data definition has no type or storage class
mod_security.c:539: error: syntax error before '}' token
mod_security.c:564: error: syntax error before "array_header"
mod_security.c:564: warning: no semicolon at end of struct or union
mod_security.c:577: error: syntax error before '*' token
mod_security.c:577: warning: data definition has no type or storage class
mod_security.c:578: error: syntax error before '}' token
mod_security.c:7106: error: request for member `boundary' in something not a structure or union
mod_security.c:7106: error: request for member `boundary' in something not a structure or union
mod_security.c:7106: error: request for member `boundary' in something not a structure or union
how to fix this problem?
 
Old 05-11-2008, 08:32 PM   #2
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey, I didn't know the answer to this one but found what might be your solution here:

http://www.gotroot.com/tiki-index.ph...p+mod_security

Below is the little snippet that I think addresses your problem. check the page link above for a more thorough explanation.

Best wishes,

Mike

Quote:
First, you will need to install the subversion-devel rpm, from the fedora legacy RPM archives. It will include the missing .h files. (Or, if you can find them from other archive, make sure you have them installed)

Edit modsecurity.c, and add these two lines to the list of #include lines:

#include <apr-0/apr_md5.h>
#include <apr-0/apr_user.h>

Then, add these symlinks:

ln -s /usr/lib/libaprutil-0.so.0 /usr/lib/libaprutil-0.so
ln -s /usr/lib/libapr-0.so.0 /usr/lib/libapr-0.so

And then compile like this:

apxs -cai -lapr-0 -laprutil-0 mod_security.c
 
Old 05-12-2008, 06:59 AM   #3
olddocks
LQ Newbie
 
Registered: Dec 2006
Posts: 23

Original Poster
Rep: Reputation: 15
i tried that not working. Here is what i found the initial lines of error i quickly stopped the script.

Quote:
[root@vps apache1]# apxs -c mod_security.c
/bin/sh /usr/lib/apr/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-0 -I/usr/include/httpd -c -o mod_security.lo mod_security.c && touch mod_security.slo
mod_security.c:32:20: ap_md5.h: No such file or directory
mod_security.c:73: error: syntax error before "security_module"
mod_security.c:73: warning: data definition has no type or storage class
mod_security.c:445: error: syntax error before "array_header"
it looks like the ap_md5.h is missing and i copied from other directory to the -I path of apxs

cp /usr/local/apache/include/ap_md5.h /usr/include/httpd

but still i am getting this bunch of errors.

Quote:
/usr/include/httpd/ap_md5.h:75: error: syntax error before "ap_MD5Init"
/usr/include/httpd/ap_md5.h:75: warning: data definition has no type or storage class
/usr/include/httpd/ap_md5.h:76: error: syntax error before "ap_MD5Update"
/usr/include/httpd/ap_md5.h:77: warning: data definition has no type or storage class
/usr/include/httpd/ap_md5.h:78: error: syntax error before "ap_MD5Final"
/usr/include/httpd/ap_md5.h:79: warning: data definition has no type or storage class
/usr/include/httpd/ap_md5.h:80: error: syntax error before "ap_MD5Encode"
/usr/include/httpd/ap_md5.h:82: warning: data definition has no type or storage class
/usr/include/httpd/ap_md5.h:83: error: syntax error before "ap_to64"
/usr/include/httpd/ap_md5.h:83: warning: data definition has no type or storage class
what could be causing this?
 
Old 05-12-2008, 12:09 PM   #4
b1v1r
ModSecurity lead developer
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by olddocks View Post
it looks like the ap_md5.h is missing and i copied from other directory to the -I path of apxs

cp /usr/local/apache/include/ap_md5.h /usr/include/httpd

but still i am getting this bunch of errors.

what could be causing this?

It looks like oyu have two apache installs (one from your distribution and one from /usr/local/apache). Perhaps you are using the wrong apxs? You should probably specify /usr/local/apache/bin/apxs.

/usr/local/apache/bin/apxs -cia mod_security.c

Also, do you have to use Apache 1.3? I suggest you use Apache 2.x so you can use ModSecurity 2.5 (1.9 is not actively maintained).

-B
 
Old 05-12-2008, 05:04 PM   #5
olddocks
LQ Newbie
 
Registered: Dec 2006
Posts: 23

Original Poster
Rep: Reputation: 15
oh thanks guys :d i was able to fix the problem from this site
 
Old 05-12-2008, 09:16 PM   #6
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Cool,

Glad I could be a part of the solution (in whatever capacity

Best wishes,

Mike
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with mod_security... Please help! jim.thornton Linux - Security 16 01-25-2008 07:25 AM
mod_security kingtas Linux - Security 4 01-20-2008 04:53 PM
mod_security problem bytez Linux - Security 2 10-01-2006 08:09 PM
Problem installing mod_security under SUSE Linux 10 Tomo3000 Linux - Software 0 02-10-2006 08:42 AM
mod_security ridertech Linux - Security 1 09-01-2004 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration