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'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
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 Oct 25 '13 at 0:49

2 Answers 2

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 (http://wiki.nginx.org/InstallOptions). 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

 
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.