By Lex Gabrees
I have create a LEMP stack and NGINX 1.4.6 is installed. I was wondering what will happen if I compile a different version of NGINX (1.10 for example) and add my modules of choice.
Will it 1.10 overwrite version 1.4.6 and is this just like ‘updating’ the previous version ? Or is it a necessary to first remove the previous version and then compile the newer version ? Basically I’m asking this because I also wan to know what happens to the virtual hosts which I might have configured … (and ofcourse config file)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If you’re worrying about your filesystem, you should back up your system prior to making the configuration change.
That being said, I’m pretty sure that by default Nginx installs its files to a different location than stock packages (prefix /usr/local/)
When compiling from source, as in, downloading the source code from NGINX and running actual build commands from the CLI, you’re able to specify the exact location of where NGINX stores files as well as what directories NGINX will use for said storage. As long as you specify different locations, the previous versions’ files and directories should remain unmodified.
You could technically run ten versions of NGINX as long as you specify different locations and names. Each of which could even have it’s own init or systemd script (though you’d most likely need to modify the ones that come along with the compile or create your own).
When doing a non-standard build, you may also need to create the directories first, otherwise the build may error out since you’re telling NGINX to use directories that do not yet exist.
When you compile and install a different version of NGINX, several considerations come into play regarding the existing installation, configuration files, and virtual hosts. Here’s a detailed guide on how to handle this process:
Overwriting vs. Removing the Previous Version:
Configuration Files and Virtual Hosts:
/etc/nginx/nginx.conf and /etc/nginx/sites-available/).Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.