An error occurred while executing the "make" command while compiling and installing the "ModSecurity- Nginx" module - linux

I am getting the error below while compiling and installing the "ModSecurity- Nginx" module.
Installing the "ModSecurity- Nginx" module
#yum install -y gcc-c++ flex bison yajl yajl-devel curl-devel curl GeoIP-devel doxygen zlib-devel pcre-devel lmdb-devel libxml2-devel ssdeep-devel lua-devel libtool autoconf automake
#cd /root
#git clone https://github.com/SpiderLabs/ModSecurity-nginx.git
#yum install libmodsecurity-devel
#cd /root/nginx-1.10.3/
#./configure --prefix=/opt/nginx --add-module=/root/ModSecurity-nginx
Compiling
#make **(Now start reporting errors)**
ERROR
/opt/ModSecurity-nginx/src/ngx_http_modsecurity_module.c: In function ‘ngx_http_modsecurity_create_ctx’:
/opt/ModSecurity-nginx/src/ngx_http_modsecurity_module.c:259:9: error: implicit declaration of function ‘msc_new_transrror=implicit-function-declaration] ctx->modsec_transaction = msc_new_transaction_with_id(mmcf->modsec, mcf->rules_set, (char *) s.data, r->conne
/opt/ModSecurity-nginx/src/ngx_http_modsecurity_module.c:259:33: error: assignment makes pointer from integer without ctx->modsec_transaction = msc_new_transaction_with_id(mmcf->modsec, mcf->rules_set, (char *) s.data, r->conne
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_modsecurity_module.o] Error 1
make[1]: Leaving directory `/root/nginx-1.16.1'
make: *** [build] Error 2

The ModSecurity nginx connector compilation is failing because it can't find the ModSecurity headers. Every time a ModSecurity function is called, it's the first time the compiler is hearing about the existence of said function, thus making this an "implicit" function declaration.
To make a long story short, you need to specify where the compiler can find the ModSecurity headers and libraries. To do this, you're supposed to set two environment variables before configuring or compiling the connector module.
export MODSECURITY_INC="/opt/ModSecurity/headers/"
export MODSECURITY_LIB="/opt/ModSecurity/src/.libs/"
These paths were taken straight from the documentation, so you'll need to adjust them depending on where yum installed the libmodsecurity-devel package.
You can find the recipes for building the ModSecurity module and the ModSecurity nginx connector here and here, respectively.

Related

Error: Lapack library not found in compile time (zerobrane, lua, torch)

After research I found:
git clone https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make NO_AFFINITY=1 USE_OPENMP=1
sudo make install
and
CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH luarocks install torch
which again left me with an error:
Makefile.system:370: *** OpenBLAS:
Cannot set both USE_OPENMP=1 and USE_THREAD=0.
The USE_THREAD=0 is only for building single thread version.. Stop.
This is the necessary change:
make NO_AFFINITY=1 USE_OPENMP=0 USE_THREAD=0
Might be an issue if only one core is available.

error: field 'ctx' has incomplete type EVP_CIPHER_CTX

Problem: I need to install Cepstral (tts engine) into Freeswitch running Debian 8. Freeswitch is already up and running, but I needed to build it from source in order for it create the mod_cepstral module.
When I run make this is the error I get:
In file included from ./crypto/include/prng.h:17:0,
from ./crypto/include/crypto_kernel.h:50,
from ./include/srtp.h:53,
from srtp/srtp.c:46:
./crypto/include/aes_icm_ossl.h:66:20: error: field ‘ctx’ has incomplete type
EVP_CIPHER_CTX ctx;
^~~
In file included from srtp/srtp.c:50:0:
./crypto/include/aes_gcm_ossl.h:58:18: error: field ‘ctx’ has incomplete type
EVP_CIPHER_CTX ctx;
^~~
Makefile:646: recipe for target 'srtp.lo' failed
make[1]: *** [srtp.lo] Error 1
make[1]: Leaving directory '/usr/src/freeswitch/libs/srtp'
Makefile:3931: recipe for target 'libs/srtp/libsrtp.la' failed
make: *** [libs/srtp/libsrtp.la] Error 2
I have been scouring the internet for solutions, but I am not a developer and this is way over my head. Any help would be appreciated.
cause newer OpenSSL don't expose struct EVP_CIPHER_CTX ,
try this
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
//do sth here
//...
EVP_CIPHER_CTX_free(ctx);
wget https://github.com/cisco/libsrtp/archive/v2.1.0.tar.gz
tar xfv v2.1.0.tar.gz
cd libsrtp-2.1.0
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install
Get the latest version of libsrtp.
It appears that there is a dependency on OpenSSL, but the version of OpenSSL you are using is incompatible. You are using OpenSSL 1.1.0 but you need to use OpenSSL 1.0.2
After talking with support at Cepstral, we determined that Jessie (Debian 8) is not yet fully compatible. I rebuilt the server with Debian 7 and it is working fine now.

build octave package from source

I want to install octaviz package in octave software.
From the documentation there is stated:
-You'll need octave 2.1.53 or later and VTK CVS to build octaviz. To compile octaviz, run ccmake . in the root directory of the source tree, then make and finally make install.
I first ran ccmake ., and it completed successfully after I installed some libs that I was missing.
But, the I ran "make" and it exits with the following errors:
>> make
[ 1%] Built target vtkWrapOctave
[ 1%] Building CXX object Common/CMakeFiles/octaviz.dir/octaviz.o
/home/user12345/octave/octaviz/Common/octaviz.cc:31:24: fatal error: octave/oct.h: No such file or directory
#include <octave/oct.h>
^
compilation terminated.
make[2]: *** [Common/CMakeFiles/octaviz.dir/octaviz.o] Error 1
make[1]: *** [Common/CMakeFiles/octaviz.dir/all] Error 2
make: *** [all] Error 2
Any idea what I am missing here?
You are missing the octave/oct.h header. This usually means that you don't have Octave installed. If you do have it installed, maybe you are missing the header files and shared libraries (if you are using Linux, did you install octave's -dev or -devel packaqes?) If you have them installed, you must have ran the configure script incorrectly. Either specify the correct options or set the CXX_FLAGS. If you don't know about compiler flags you probably should not change them and instead figure out how to install the octave libraries correctly.

Strange error while trying to make install Gtkaml (and libvala-0.16) in Ubuntu

I have downloaded and tried to install Gtkaml but I am having troubles.
I followed their instructions to install it, but it still fails.
I downloaded it into my downloads folder, then ran Terminal:
cd ~/Downloads
ls
cd gtkaml-0.5.94
./configure
But then it failed at ./configure, I can't remember what it was, but it was missing something so I then ran:
sudo apt-get build-dep gtkaml, then I re-ran ./configure and it succeeded. So then I proceeded to sudo make, but then it said,
jase#Jase-PC:~/Downloads/gtkaml-0.5.94$ sudo make make all-recursive
make1: Entering directory /home/jase/Downloads/gtkaml-0.5.94'
Making all in libgtkaml make[2]: Entering directory
/home/jase/Downloads/gtkaml-0.5.94/libgtkaml' /usr/bin/valac -C -H
gtkaml.h --library gtkaml --vapidir . --pkg config --pkg glib-2.0
--pkg libvala-0.16 --pkg libxml-2.0 --pkg gio-2.0 gtkamlcodecontext.vala gtkamlmarkupparser.vala gtkonparser.vala
gtkamlmarkupscanner.vala gtkamlmarkupresolver.vala
gtkamlcodeparserprovider.vala ast/gtkamlmarkupattribute.vala
ast/gtkamlmarkupcomplexattribute.vala gtkamlmarkupclass.vala
ast/gtkamlmarkuptag.vala ast/gtkamlmarkuproot.vala
ast/gtkamlmarkupchildtag.vala ast/gtkamlmarkupunresolvedtag.vala
ast/gtkamlmarkupmember.vala ast/gtkamlmarkuptemp.vala
ast/gtkamlmarkupreference.vala gtkamlmarkupnamespace.vala
gtkamlmarkuphint.vala gtkamlmarkuphintsstore.vala
gtkamlpropertyspec.vala workarounds/gtkamldatatypeparent.vala
workarounds/gtkamlcallable.vala workarounds/gtkamlvalaparser.vala
workarounds/gtkamlnamespacevisitor.vala error: Package libvala-0.16'
not found in specified Vala API directories or GObject-Introspection
GIR directories Compilation failed: 1 error(s), 0 warning(s) make[2]:
*** [libgtkaml.stamp] Error 1 make[2]: Leaving directory/home/jase/Downloads/gtkaml-0.5.94/libgtkaml' make1: *
[all-recursive] Error 1 make1: Leaving directory
`/home/jase/Downloads/gtkaml-0.5.94' make: * [all] Error 2
So then I ran sudo apt-get install libvala-0.16 to install libvala-0.16. It then said,
Reading package lists... Done Building dependency tree Reading
state information... Done Note, selecting 'libvala-0.16-dev' for regex
'libvala-0.16' Note, selecting 'libvala-0.16-0' for regex
'libvala-0.16' Note, selecting 'libvala-0.16-0-dbg' for regex
'libvala-0.16' libvala-0.16-0 is already the newest version.
libvala-0.16-0-dbg is already the newest version. libvala-0.16-dev is
already the newest version. The following packages were automatically
installed and are no longer required: libqt5declarative5 par2
python-support Use 'apt-get autoremove' to remove them. 0 to upgrade,
0 to newly install, 0 to remove and 0 not to upgrade.
So I re-ran sudo make. But same error as the original make error.
How do I make/make install this thing?
This should fix the problem
sudo apt-get install libvala-0.16-dev
What you need is a libvala development package.
I have been unable to make from source obtained from the Google code website. But I have been able to install it from the Software Center.
I have written and compiled a sample application:
<Window xmlns:g="http://gtkaml.org/0.4" xmlns="Gtk" g:name="GTKamlSample"
type="{WindowType.TOPLEVEL}" title="Window"
position="{WindowPosition.CENTER}" default-width="300" default-height="150"
destroy="Gtk.main_quit">
<Button label="Click me." clicked='{target.label="Thank you.";}' />
<![CDATA[
static int main (string[] args)
{
Gtk.init(ref args);
var window = new GTKamlSample();
window.show_all();
Gtk.main();
return 0;
}
]]>
</Window>
Which works. So your best bet is to use Software Center if you run into troubles installing it from source.

How can I install git on my webserver with a curl.h no such file error

I have been trying to install Git on my web server. When i try "make install" i get the following errors which I cant seem to get past.
[root#site git-core-0.99.6]# make install
gcc -o http-pull.o -c -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' http-pull.c
http-pull.c:6:23: error: curl/curl.h: No such file or directory
http-pull.c:7:23: error: curl/easy.h: No such file or directory
http-pull.c:16: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
http-pull.c: In function âfetch_indexâ:
http-pull.c:102: warning: implicit declaration of function âcurl_easy_setoptâ
There is alot more of that if you need to see it, but though part of it would cover the issue
It looks like you're missing the curl development package, maybe if you install the source available here (or with the package manager of your distribution), it will work better.
For example, under debian, install libcurl4-gnutls-dev

Resources