0

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?

Andrew Grothe
  • 195
  • 1
  • 7
  • 1
    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 Kalimuthu Oct 25 '13 at 00:49

2 Answers2

3

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.

Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83
  • 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. – Andrew Grothe Nov 08 '13 at 00:33
1

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 (http://wiki.nginx.org/InstallOptions). Usually, choosing a path under /opt as prefix path is a good idea.

  • 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. – Andrew Grothe Oct 25 '13 at 11:29