Nginx failed test version 1010002 instead of 1012000 in /usr/share/nginx/modules/mod-http-image-filter.conf

19,723

Solution 1

Posting another solution for people having similar problems, running these following commands worked for me on Centos 7 after I had already configured yum to look to the latest version:

sudo yum remove nginx-mod*
sudo yum install nginx-module-*

Here are some more details

Solution 2

In case Someone face the same problem i invite him to follow these steps to resolve the issues of the compatibility:

before making the module ngx_http_modsecurity_module.so that needed to be load in nginx.conf config file under /etc/nginx/nginx.config.

load_module modules/ngx_http_modsecurity_module.so;

  1. perform version check against your pre-installed nginx
  2. `$ nginx -v`
    in my case `nginx version: nginx/1.15.10 `
  3. download the same version
  4. `$ wget http://nginx.org/download/nginx-1.15.10.tar.gz`
  5. $ tar zxvf nginx-1.15.10.tar.gz
  6. $ cd nginx-1.15.10
  7. $ ./configure --with-compat --add-dynamic-module=/path_to_your/modsecurity-nginx-connector
  8. $ cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules
  9. add the module to nginx at the beginning of the /etc/nginx/nginx.conf file, after the `user` directive
  10. `load_module modules/ngx_http_modsecurity_module.so;`
  11. $ nginx -t
  12. `nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful `

and continue the process... as described here nginx.org hope im helpful.

Solution 3

Rollback to 1.10.2. nginx: [emerg] module "/etc/nginx/modules/ngx_http_geoip_module.so" version 1010002 instead of 1013002 in /etc/nginx/nginx.conf:12 nginx version: nginx/1.13.2

Solution 4

I found that I needed to obliterate all the previous nginx-related files rm -rf /etc/nginx and then after another make install everything checked out.

Share:
19,723

Related videos on Youtube

oach
Author by

oach

Updated on October 20, 2022

Comments

  • oach
    oach over 1 year

    Upgraded nginx on a centos 6 test system from 1.10.x to 1.12.x via yum update. I then followed steps to get GeoIP module working (https://tushev.org/articles/linux-bsd/32/using-dynamic-geoip-module-with-nginx-centos).

    When I run nginx -t, the following error is displayed:

    $ nginx -t
    nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_image_filter_module.so" version 1010002 instead of 1012000 in /usr/share/nginx/modules/mod-http-image-filter.conf:1
    nginx: configuration file /etc/nginx/nginx.conf test failed
    

    In my nginx.conf file I commented out the line below

    include /usr/share/nginx/modules/*.conf;
    

    and nginx worked as expected again. That's great but doesn't solve my problem. Since this is a dev environment I need to get this working 100%. I am unsure that I really need the image filter after reading the specs (http://nginx.org/en/docs/http/ngx_http_image_filter_module.html).

    Further, I did add individual modules back with luck as well:

    load_module "modules/ngx_http_geoip_module.so";
    

    I would like to know how to solve the version issue that the error displays and to know if omitting these modules, outside of the one I want, is okay?

    Thank you for your time and consideration.

  • RaphaelDDL
    RaphaelDDL almost 4 years
    A blog post I've found later (which is for Brotli, but could've been changed to any other dynamic module) is majlovesreg.one/adding-brotli-to-a-built-nginx-instance The script works pretty well in upgrading the dynamic module after upgrading an already existing nginx (e.g. 1.17.10 to 1.18.0 will give the version mismatch).
  • johndpope
    johndpope over 3 years
    I'm confused on5. - path_to_your/modsecurity-nginx-connector I just have a vanilla nginx installed in /etc/ - there's no mention of modsecurity...