-1

I have installed nginx/1.12.1 and Phusion Passenger by APT from https://oss-binaries.phusionpassenger.com repository. It's configured correctly within my Rails apps.

Thereafter, I want to improve nginx by adding nginx pagespeed module dynamically following this https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source to build ngx_pagespeed module and following this https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/ to compile dynamic module, by running :

$ ./configure --with-compat --add-dynamic-module=$HOME/ngx_pagespeed-${NPS_VERSION} ${PS_NGX_EXTRA_FLAGS}

$ make modules

After that, I copied ngx_pagespeed.so from objs/ folder into /etc/nginx/modules and of course loading the module into nginx.conf by adding load_module modules/ngx_pagespeed.so; on it. But when I reload nginx it's reproduced following error:

nginx: [emerg] module "/usr/share/nginx/modules/ngx_pagespeed.so" is not binary compatible in /etc/nginx/nginx.conf:5

My question is:

  1. How do I add ngx_pagespeed module on nginx from PhusionPassenger APT?

  2. What is the right ./configure flags for compiling additional module without forgetting previous installed nginx (from PhusionPassenger APT) modules?

Thank you

Mkhuda
  • 69
  • 9
  • 1
    Please add which OS & passenger version # you are on. – Camden Narzt Oct 26 '17 at 13:47
  • 1
    I think you are using system nginx of different version and then compiling module using different version source code. You should check system version using `nginx -v` and use the same source code for module compiling? Also use `nginx -V` to get the compilation flags. Use the same flags – Tarun Lalwani Oct 26 '17 at 18:19
  • Possible duplicate of [403 Forbidden on Rails app w/ Nginx, Passenger](https://stackoverflow.com/questions/19553907/403-forbidden-on-rails-app-w-nginx-passenger) – Mkhuda Oct 27 '17 at 20:29

1 Answers1

2

On ubuntu xenial, you'll have an easier time adding your configure flags to the passenger-install-nginx-module script like so: passenger-install-nginx-module --extra-configure-flags="--with-compat --add-dynamic-module=$HOME/ngx_pagespeed-${NPS_VERSION} ${PS_NGX_EXTRA_FLAGS}" instead of using the nginx-extras package, as matching the flags from the packaging process at phusion is a pain. You can read more about it here: https://www.phusionpassenger.com/library/install/nginx/customizing_compilation_process.html

Camden Narzt
  • 2,271
  • 1
  • 23
  • 42