Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Compile Mod Security 2.5.9 on Solaris 10

Posted on 2009-04-06
11
Medium Priority
?
1,877 Views
Last Modified: 2013-12-21
Hi,
I am using Apache 2.0.63 which came installed with Solaris 10 (SPARC)

Some problems here when I tried to do a make. My options for configure was:
CC=/usr/sfw/bin/gcc CXX=/usr/sfw/bin/g++ ./configure --with-apxs=/usr/apache2/bin/apxs  --with-apr=
error was:
  :
  :
# make
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o mod_security2.lo mod_security2.c && touch mod_security2.slo
/var/apache2/build/libtool: line 1279: /opt/SUNWspro/bin/cc: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
The following command caused the error:
src=""; \
for f in mod_security2 apache2_config apache2_io apache2_util  re re_operators re_actions re_tfns re_variables  msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre  persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release; do \
        src="$src $f.c"; \
done; \
rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
build/apxs-wrapper -c -I/usr/apache2/include    -I/usr/local/include -I/usr/local/include/libxml2   -L/usr/local/lib -R/usr/local/lib -lpcre -L/usr/local/lib -R/usr/local/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl  -Wc,-O2 -Wc,-g -Wc,-Wall  $src
make: Fatal error: Command failed for target `mod_security2.la'

Open in new window

0
Comment
Question by:QLJ
  • 6
  • 5
11 Comments
 
LVL 1

Author Comment

by:QLJ
ID: 24075901
i made a mistake as I pointed to the wrong path for gcc. Once corrected, I got a new set of error msgs
:
:
cc: unrecognized option `-Xa'
cc: unrecognized option `-KPIC'
cc: language O4 not recognized
cc: msc_lua.c: linker input file unused because linking not done
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o msc_release.lo msc_release.c && touch msc_release.slo
cc: unrecognized option `-Xa'
cc: unrecognized option `-KPIC'
cc: language O4 not recognized
cc: msc_release.c: linker input file unused because linking not done
/var/apache2/build/libtool --silent --mode=link /opt/SUNWspro/bin/cc -o mod_security2.la -R/usr/local/lib -R/usr/local/lib  -L/usr/local/lib -L/usr/local/lib -lpcre -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl -rpath /usr/apache2/libexec -module -avoid-version    msc_release.lo msc_lua.lo acmp.lo msc_geo.lo pdf_protect.lo msc_reqbody.lo persist_dbm.lo msc_pcre.lo msc_util.lo msc_parsers.lo modsecurity.lo msc_multipart.lo msc_xml.lo msc_logging.lo re_variables.lo re_tfns.lo re_actions.lo re_operators.lo re.lo apache2_util.lo apache2_io.lo apache2_config.lo mod_security2.lo
ld: fatal: file .libs/msc_release.o: open failed: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
The following command caused the error:
src=""; \
for f in mod_security2 apache2_config apache2_io apache2_util  re re_operators re_actions re_tfns re_variables  msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre  persist_dbm msc_reqbody pdf_protect msc_geo acmp msc_lua msc_release; do \
        src="$src $f.c"; \
done; \
rm -f msc_test msc_test.o msc_test.lo msc_test.slo; \
build/apxs-wrapper -c -I/usr/apache2/include    -I/usr/local/include -I/usr/local/include/libxml2   -L/usr/local/lib -R/usr/local/lib -lpcre -L/usr/local/lib -R/usr/local/lib -lxml2 -lz -lpthread -liconv -lm -lsocket -lnsl  -Wc,-O2 -Wc,-g -Wc,-Wall  $src
make: Fatal error: Command failed for target `mod_security2.la'

Open in new window

0
 
LVL 22

Expert Comment

by:Brian Utterback
ID: 24076339
Well, the problem is your first statement. You need to compile the apache mods in the same manner
used by the apache executable. That is the whole reason for having libtool, after, to get the options and
choices to match.  So, you cannot use gcc to compile the mod, you need to use Sun Studio.

You can get it for free. There are several links on Sun's website. Here is one:
http://developers.sun.com/sunstudio/downloads/
0
 
LVL 1

Author Comment

by:QLJ
ID: 24085164
I am having major problems getting sun studio to run. Is there a way i can run sunstudio's compiler at cmd line?

Appreciate all guidance.. am a newbie with sunstudio.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:Brian Utterback
ID: 24085689
Actually, your last question confuses me, because the only way I ever run sunstudio compilers is from
the command line. So, yes, of course, you can run it from the command line. Just set your path appropriately and then type "cc".  You may be having problems with your path, because you may have more than on "cc" on your path.
0
 
LVL 1

Author Comment

by:QLJ
ID: 24086707
hi blu, evidently, i have never used sunstudio before. ;)

1) I can't seem to find the CC with SunStudio (default path?)
2) sample command to use to compile at the command line.
0
 
LVL 22

Expert Comment

by:Brian Utterback
ID: 24088129
Usually, the Sun Studio compilers install in /opt, in SUNWspro. So, the full path to the c compiler would be /opt/SUNWspro/bin/cc and for the C++ compiler, /opt/SUNWspro/bin/CC.
The simplest command to compile a c program would be

/opt/SUNWspro/bin/cc   -o main main.c
0
 
LVL 1

Author Comment

by:QLJ
ID: 24127714
I hate to say this, but it doesn't seem to be working right - for the SunStudio method of running /opt/SUNWspro/bin/cc   -o modsecurity modsecurity.c

By the way, the documentation in modsecurity website did  say to compile using ./configure
http://www.modsecurity.org/documentation/modsecurity-apache/2.5.9/modsecurity2-apache-reference.html#installation

Is there a reason or anyway to troubleshoot why I cant get it to work on mine?
0
 
LVL 22

Expert Comment

by:Brian Utterback
ID: 24129111
I didn't say not to compile with configure, I just said to use the Sun Studio compiler. just add /opt/SUNWspro/bin to
the beginning of your path before you call configure, and otherwise proceed as you would normally.
0
 
LVL 1

Author Comment

by:QLJ
ID: 24135360
Whoops.. totally misinterpreted..
well, i tried adding /opt/SUNWspro/bin to path. I now have a different error set:

# make
/var/apache2/build/libtool --silent --mode=compile /opt/SUNWspro/bin/cc -prefer-pic -xO3 -xarch=v8 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xO4 -DSSL_EXPERIMENTAL -DSSL_ENGINE  -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/apache2/include  -I/usr/apache2/include   -I/usr/apache2/include -I/usr/sfw/include -O2 -g -Wall -I/usr/apache2/include -I/usr/local/include -I/usr/local/include/libxml2  -c -o mod_security2.lo mod_security2.c && touch mod_security2.slo
cc: illegal option -Wall
apxs:Error: Command failed with rc=65536
0
 
LVL 1

Author Comment

by:QLJ
ID: 24153753
ok, i solved it... just went into the Makefile and deleted all -Wall

Problem is, would there be any implications if i do that?rything looks ok so far...
0
 
LVL 22

Accepted Solution

by:
Brian Utterback earned 240 total points
ID: 24156091
If it worked, then there is no implications. The "-Wall" flag simply tells gcc to not print any warnings and be
more quiet. So, it doesn't effect the resulting object file, just the compilation noise. If you didn't see any
worisome warnings that got you upset, then everything is fine.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question