Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  1. Download the source for Nginx
  2. Add the additional modules with ./configure --additional-module
  3. Compile Nginx with make
  4. Stop the current server (service nginx stop)
  5. Install Nginx with make install
  6. 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?

like image 834
Ivar Avatar asked Nov 04 '13 23:11

Ivar


1 Answers

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.

like image 74
CDub Avatar answered Sep 28 '22 12:09

CDub