0

I needed to add ngx_pagespeed module to my nginx server. I followed an automated install as descriped here: https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source

This downloaded and built latest Nginx version 1.17.4 with ngx_pagespeed module inside my /root. I made sure to build it with the same modules/flags I had in my original Nginx instance.

Now Nginx fails to start. Also when I check Nginx -v, I get 1.14.0, which is what I had initially. How do I switch to use the new build?

1 Answer 1

1

Looks like you have built your binary in another directory then the one installed from the distribution repo. And to which your systemd file is pointing. The best course of action now is to just rebuild the binary using the correct installation directory.

  1. Check where is your current nginx binary is

    which nginx

  2. Then run the ./configure script with this parameter like that

    ./configure --sbin-path=$output_from_previous_command --add-module=$HOME/$nps_dir ${PS_NGX_EXTRA_FLAGS}

However, you might need to pass additional parameters, if they are different from the default. For example, check where your nginx conf files reside and consult the documentation[1] for default values. If they are different, pass them to the command also.

[1] http://nginx.org/en/docs/configure.html

1
  • You're absolutely right! I was copying all other flags from nginx -V, except for the --sbin-path which is not output but that command. Thanks!
    – geochanto
    Oct 6, 2019 at 22:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .