Recompile Nginx with Additional Modules

I installed Nginx via apt-get on Debian some time ago, and I have several sites living on it. Now I need to install some additional modules, and since I do not want to ruin anything, I would like to double check my process before executing it. Hope this also helps others who are not sure about this part.

As I understand it, I need to do the following in order to minimize downtime:

  • Download source for Nginx
  • Add additional modules with ./configure --additional-module
  • Compile Nginx with make
  • Stop the current server ( service nginx stop )
  • Install Nginx with make install
  • Start a new server ( service nginx start )

Or do I need to remove Nginx first, as it is not compiled from the source at this point?

+7
compilation nginx
source share
2 answers

Having done something similar on Ubuntu earlier, the installation should only overwrite existing nginx binaries with compiled ones, if so, you guarantee that nginx will not work on the system at that time.

I would recommend installing nginx elsewhere on the system, so if you cannot get it to work fast, you can restart your web server with old nginx binaries and not have significant downtime.

+3
source share

nginx -V is a useful command that shows options for. \ configure, which was used to create nginx, which actually works. It is useful to get a detailed imagination.

apt-get source nginx - to get the source

install will automatically replace the actual installed version with a new one

Keep in mind that some nginx modules may require additional libraries on the server. geoip is a classic example of this

0
source share

All Articles