Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred when compiling and installing modsecurity #3242

Open
yancong303 opened this issue Aug 27, 2024 · 3 comments
Open

An error occurred when compiling and installing modsecurity #3242

yancong303 opened this issue Aug 27, 2024 · 3 comments
Labels
3.x Related to ModSecurity version 3.x

Comments

@yancong303
Copy link

yancong303 commented Aug 27, 2024

I installed modsecurity on centos7, operating system version 3.10.0-1160.105.1.el7.x86_64. At the beginning of my operating system gcc version is gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), there is no problem when installing modsecurity at this time. Since I needed to install opencv, I later upgraded the gcc version and the updated gcc version is gcc (GCC) 9.3.0
An exception occurred when I installed modsecurity on the server after upgrading the gcc version.
There is always an error in the make compilation, I have seen on the official website, I have installed the required dependencies, but the error is still reported, the error log is as follows.

Making all in others
Make [1] : enter the directory "/ usr/local/modsecurity/others"
make[1]: You don't have to do anything with "all".
Make [1] : leave the directory "/ usr/local/modsecurity/others"
Making all in src
Make [1] : enter the directory "/ usr/local/modsecurity/SRC"
make  all-recursive
Make [2] : enter the directory "/ usr/local/modsecurity/SRC"
Make [3] : enter the directory "/ usr/local/modsecurity/SRC"
Make [3] : leave the directory "/ usr/local/modsecurity/SRC"
Make [2] : leave the directory "/ usr/local/modsecurity/SRC"
Make [1] : leave the directory "/ usr/local/modsecurity/SRC"
Making all in doc
Make [1] : enter the directory "/ usr/local/modsecurity/doc"
make[1]: You don't have to do anything with "all".
Make [1] : leave the directory "/ usr/local/modsecurity/doc"
Making all in tools
Make [1] : enter the directory "/ usr/local/modsecurity/tools"
Making all in rules-check
Make [2] : enter the directory "/ usr/local/modsecurity/tools/rules - check"
/bin/sh .. /.. /libtool  --tag=CXX   --mode=link g++  -g -O2 -L/usr/lib64/  -lpcre -L/usr/lib64/ -L/usr/lib64/ -L/usr/lib64/  -lpcre -o  modsec-rules-check modsec_rules_check-rules-check.o .. /.. . / SRC/libs/libmodsecurity. La - lGeoIP - LRT - lxml2 - lz - lm - LDL - LLMDB - llua - 5.1 - lpcre lpcre -- lfuzzy
libtool: link: g++ -g -O2 -o .libs/modsec-rules-check modsec_rules_check-rules-check.o  -L/usr/lib64/ .. /.. /src/.libs/libmodsecurity.so /usr/lib/.. /lib64/libstdc++. so-lGeoIP-lrt-lxml2-lz-lm-ldl-llmdb-llua-5.1-lpcre-lfuzzy-Wl,-rpath -Wl,/usr/local/modsecurity/lib -Wl,-rpath -Wl,/usr/lib/.. /lib64
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_easy_perform'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_easy_init'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_easy_strerror'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_slist_append'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_easy_cleanup'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_slist_free_all'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_easy_setopt'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_global_init'
.. /.. /src/.libs/libmodsecurity.so: undefined reference to `curl_global_cleanup'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:542: modsec-rules-check] Error 1
Make [2] : leave the directory "/ usr/local/modsecurity/tools/rules - check"
make[1]: *** [Makefile:474: all-recursive] Error 1
Make [1] : leave the directory "/ usr/local/modsecurity/tools"
make: *** [Makefile:1015: all-recursive] Error 1

What is my problem? How can I solve it? Who can help me?

@yancong303 yancong303 added the 3.x Related to ModSecurity version 3.x label Aug 27, 2024
@airween
Copy link
Member

airween commented Aug 27, 2024

When you run ./configure, you get a summary at the end. Could you show that result?

@yancong303
Copy link
Author

Thanks for your help, I tried to add a parameter to configure./configure --without-curl, and then make &&make install to complete the installation, although the installation is complete, I am not sure if this is OK

@airween
Copy link
Member

airween commented Aug 27, 2024

Thanks for your help, I tried to add a parameter to configure./configure --without-curl, and then make &&make install to complete the installation, although the installation is complete, I am not sure if this is OK

Right.

If you don't need curl you don't need to link it, this is why --without-curl option was introduced. If you want to be sure that everything is okay, you can run after make (and before make install, but you can run it now indeed) the command make check. This will run all regression tests. If every tests are passed you can be sure. But you can't use some functions like SecRemoteRules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

No branches or pull requests

2 participants