Recompile Nginx with additional modules

I installed Nginx via apt-get on Debian a while ago, and I've got a couple of sites live on it. Now I need to install some additional modules, and as I don't want to mess anything up I'd like to double check my process before I perform it. Hopefully this will also help others that are unsure about this part.

As I've understood it I have to do the following to minimize the downtime:

  • Download the source for Nginx
  • Add the additional modules with ./configure --additional-module
  • Compile Nginx with make
  • Stop the current server ( service nginx stop )
  • Install Nginx with make install
  • Start the new server ( service nginx start )
  • Or do I have to uninstall Nginx first, as it's not compiled from source at this point?


    Having done something similar on Ubuntu before, the installation should overwrite the existing nginx binaries with the newly compiled ones, so long as yes, you ensure nginx isn't running on the system at the time.

    I'd recommend trying to install nginx elsewhere on the system, so in case you can't get it to work quickly, you can restart your web server with the old nginx binaries and not have significant downtime.


    nginx -V - helpful command which shows options for .configure which was used to make nginx, which is actually working. Helpful to get detail imagination about.

    apt-get source nginx - to get source

    install will automatically substitute actual installed version by new one

    Keep also in mind that some nginx-modules can require additional libs on server. geoip module is classical example of it

    链接地址: http://www.djcxy.com/p/17024.html

    上一篇: MySQL的正则表达式的UTF

    下一篇: 用附加模块重新编译Nginx