Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a webserver and streaming video server on the same ubuntu box. I have the resources on the box to handle everything and in time will probably use two boxes but I don't want the overhead of two boxes right now.

I would like to run two versions of nginx, one with the rtmp module compiled in and one with out. My reason for this is that I do a lot of tuning with HLS settings and adding various options, etc, and need to restart nginx to have the changes picked up.

I don't want to be restarting nginx with websites hosted though.

Can I safely install nginx in two locations?

share|improve this question
While you can install & run two version of Nginx from two locations, they can't have the same value for listen directive! The OS can't allocate the same port to two Nginx versions. – Pothi Oct 25 '13 at 0:49
up vote 1 down vote accepted

I would install the "standard" nginx (which serves websites) from your distribution repositories, and compile the second one with custom modules.

In order not to overwrite the packaged nginx, you can use the compile-time options of configure to set a custom install path ( Usually, choosing a path under /opt as prefix path is a good idea.

share|improve this answer
This is what I was thinking about doing, but wasn't sure if there could still be conflicts. Although the "standard" from repos is still pretty old, 1.2 I think. – agrothe Oct 25 '13 at 11:29

I would use Linux containers (LXC) or something similar to install the other Nginx instance. This will help you move the environment easier to another machine.

You will have the advantage of separation of the environments and low overhead.

share|improve this answer
While I agree this is the best way to do this, Martin's answer was what I was looking for in this particular case. Thanks for introducing me to LXC though, I will have to investigate further. – agrothe Nov 8 '13 at 0:33

Your Answer


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.