Error after update Nginx/Directadmin with Mod_Security !

rowebca

Verified User
Joined
Jan 3, 2020
Messages
68
Location
Montreal, QC, Canada
Hi,

After update of Directadmin and Nginx - 1.21.5 (custombuild) Nginx server went down because of problems with Mod_Security:

cc: error: ../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_pre_access.c: No such file or directory
cc: fatal error: no input files

-o objs/addon/src/ngx_http_modsecurity_module.o \
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c: In function 'ngx_http_modsecurity_pcre_malloc_init':
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c:78:9: error: 'pcre_malloc' undeclared (first use in this function); did you mean 'old_pcre_malloc'?
if (pcre_malloc != ngx_http_modsec_pcre_malloc) {
^~~~~~~~~~~
old_pcre_malloc
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c:78:9: note: each undeclared identifier is reported only once for each function it appears in
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c:82:25: error: 'pcre_free' undeclared (first use in this function); did you mean 'pkey_free'?
old_pcre_free = pcre_free;
^~~~~~~~~
pkey_free
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g '-D FD_SETSIZE=32768' -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/http/v2 -I /usr/local/modsecurity/include \
-o objs/addon/src/ngx_http_modsecurity_pre_access.o \
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_pre_access.c
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c: In function 'ngx_http_modsecurity_pcre_malloc_done':
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c:102:9: error: 'pcre_malloc' undeclared (first use in this function); did you mean 'old_pcre_malloc'?
pcre_malloc = old_pcre_malloc;
^~~~~~~~~~~
old_pcre_malloc
../modsecurity-nginx-v1.0.2/src/ngx_http_modsecurity_module.c:103:9: error: 'pcre_free' undeclared (first use in this function); did you mean 'pkey_free'?
pcre_free = old_pcre_free;
^~~~~~~~~
pkey_free
make[1]: *** [objs/Makefile:1358: objs/addon/src/ngx_http_modsecurity_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/usr/local/directadmin/custombuild/nginx-1.21.5'
make: *** [Makefile:10: build] Error 2
ModSecurity Connector v1.0.2 is now enabled in Nginx
LibModSecurity has been installed successfully.
Job for nginx.service failed because the control process exited with error code.


I had to disable Mod+Security and reinstal nginx_apache to corect this, but no Mod_Security in place.
Is this a problem after update Directadmin?

Regards,
George B.
 
Check mirror , I had similar case :

[root@ns4 custombuild]# grep download /usr/local/directadmin/custombuild/options.conf
downloadserver=files7.directadmin.com

SUPPORT DA : [iles7 is an unofficial mirror, try:
cd /usr/local/directadmin/custombuild
./build set_fastest
./build update
./build nginx
 
Check mirror , I had similar case :

[root@ns4 custombuild]# grep download /usr/local/directadmin/custombuild/options.conf
downloadserver=files7.directadmin.com

SUPPORT DA : [iles7 is an unofficial mirror, try:
cd /usr/local/directadmin/custombuild
./build set_fastest
./build update
./build nginx
Thank you, I fixed by going back to Nginx 1.21.4...I have nginx_apache not just Nginx.

Regards,
George B.
 
It's due to Nginx 1.21.5+ defaulting to PCRE2 v10.x if detected instead of older PCRE v8.4x. Modsecurity Nginx and Nginx Lua modules are not compatible with PCRE2 yet from my testing on non-DirectAdmin systems. So for DirectAdmin if they want to do Nginx 1.21.5, they would need to pass --without-pcre2 flag to Nginx builds so it falls back to older PCRE library.

HTH :)
 
The custombuild Nginx update has passed 2 minor versions (more than 2 months already). Please take a look at the suggestion from @eva2000 if that helps @DirectAdmin Support

Error log:

make[1]: *** [objs/Makefile:1358: objs/addon/src/ngx_http_modsecurity_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/usr/local/directadmin/custombuild/nginx-1.21.6'
make: *** [Makefile:10: build] Error 2
Done!
 
It looks like the option --without-pcre2 is being used now.

Seems like the old version does not work anymore so you have to remove it from custom /usr/local/directadmin/custombuild/custom_versions.txt

Thanks.
 
I need one help
if you need real support or a consultant that info is found here
 
Back
Top