Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What do you mean "compile itself" versus "install over official NGINX source"? –  gWaldo Dec 11 '12 at 12:50
    
@gWaldo meant the official packages –  thde Dec 11 '12 at 14:43
    
Ah I see. I've updated my answer regarding the nginx yum repository. –  gWaldo Dec 11 '12 at 14:55
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
Thank you. I'll go for the official NginX packages. –  thde Dec 11 '12 at 15:05
add comment

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.