0

I'd like to install NginX as a reverse proxy on CentOS. I know three different ways to install NginX:

  • Compile itself
  • Install over EPEL
  • Install over official NginX package repository

Which way would you recommend for production use? Are there any cons for installing NginX over the official source?

thde
  • 103
  • 5

2 Answers2

1

Installing from your distro's package manager is usually more convenient, but you're at their whim as to what version that you are going to run. (Hint: It's an older version.)

Installing from source is more effort, but you get newer code (and the ability to make a decision on what version you are running). Additionally, you can compile in additional options and features that may not be included in the package version. Finally, compiling on your target machine allows the compiler to optimize for the processor features available on that system, where distro packages are compiled to a lowest-common denominator, so they may not perform as well.

If you use the nginx yum repo (details), you will get the convenience of using the package manager, but the version is much more likely to be kept up-to-date. You still will not get the processor-optimizations that compiling it yourself would yield, however.

gWaldo
  • 11,887
  • 8
  • 41
  • 68
0

Don't install from source (as in make install). It is best practice to install software using packages. Packages make the process consistent and reproducible. For example if you need to deploy a second machine, or replace a failed machine. Package maintainers also update packages to fix security problems. Using packages will make automated deployment (using configuration management) easier.

If the EPEL version is too old you can get the official packages from nginx.org. But be aware that unlike EPEL they do not maintain version stability, meaning version updates may be incompatible with existing configurations. For that reason it is a good idea to maintain your own yum or apt repository with the version you use.

You can also compile and package from source yourself, which might be needed if you have special modules you need included.

Anton Cohen
  • 1,112
  • 6
  • 7
  • Absolutely agree. If you need to include special modules, you can take src.rpm and enable them there too. beware: after upgrade, your package will be replaced with original EPEL one if you won't take a look at that. – GioMac Dec 11 '12 at 22:22