Here is how to keep Ubuntu apt-get install nginx updated to current version. By default it does not work. We do some steps on cloud server. The word Cloud Server is arriving as, normally lot of versions of Linux distro are offered as boot image for an instance. There is difference in philosophy of a VPS and Cloud Server. Single VPS should be more faster than Single Cloud Server. We use Cloud Server for various reasons including scalability.
How To Keep Ubuntu apt-get install nginx Updated : Why Not Building Nginx From Source?
Building Nginx from source demands a bit knowledge on Linux / UNIX. Not all are efficient. Nginx installation via package manager is easy to update by anyone. You can learn more on Advanced Packaging Tool (apt) and aptitude. We wrote easy guide to install Nginx on Ubuntu. WordPress is an example, we could install Drupal. Rackspace or DigitalOcean or HP Cloud or a VPS, methods will be same.
Another advantage is that, anyone can understand which file or directory is where for troubleshooting. On building from source, it can vary.
---
Running nginx -v
(lowercase v) will show your current STABLE version.
Info About Nginx and F/OSS
This is what you’ll use on a production server. There are other Nginx named Nginx Plus, Nginx Media :
1 | http://nginx.com/products/feature-matrix/ |
It is paid. We do not know whether they has GPLed version. Apache2 is 100% free. You’ll see bigger website’s Nginx performs a bit differently. Because they use the paid version with some tweaks. Possibly 50% of you never knew that why Amazon’s and HP Cloud’s some website outperforms your setup. They probably collect our data and build better software for a fee. That is basically against GNU psychology to allow a non-free software to get installed. They tracks. That is why Richard Stallman do not list many Linux on their repo. Allowing non-free OS or kind of variant opens a backdoor. Unless you fork, rename and distribute without any trouble from the main developer – it is not a free software. GNU has lot of softwares which are 100% free. Apache2 sucks RAM, but still Apache is a Free Software License itself.
In last 4 years plus, we saw many such Free
to become 100% paid. Kalithra recent thing out of such odd License.
Nobody donate one dollar for software development. The Author of this article had Artificial Pacemaker project. None donated a single dime. Fully blaming to make paid software is also not humane. Apache2 can run because many donates for them. There are risks of asking money – the software can get hijacked by SLA for donation. You have register a separate entity to get donation from the organization. That is not free. WordPress dot org
runs out of money from the web hosts (they have recommended lists) and Ads on free WordPress dot com
blogs. But, $1700 / year is too much :
1 | https://aws.amazon.com/marketplace/pp/B00A04GAG4 |
Hacking, GPL-ing via reverse engineering starts for so much abnormal pricing.
How To Keep Ubuntu apt-get install nginx Updated
We are talking about the F/OSS Nginx.
Basically, we need to add a PPA, like we wrote in for building own distribution. Basically on our that Nginx guide, we added :
1 2 | apt-get install python-software-properties add-apt-repository ppa:nginx/stable |
That did the trick. But you might need to force upgrade :
1 | apt-get upgrade nginx -f |
Press N
to keep the Nginx configuration file /etc/nginx/nginx.conf
, otherwise you’ll get screwed.
Latest version is 1.7 :
1 | https://github.com/nginx/nginx |
But, we are using Stable. If you used this :
1 | add-apt-repository ppa:nginx/development |
Instead of stable
, you would get 1.7
now. When we add PPA, it refers to place like this :
1 | http://ppa.launchpad.net/nginx/development/ubuntu/dists/vivid/Release |
If you want “Automatic” update on Debian (not Ubuntu, Ubuntu adds Repo on that add-apt
command), you need to edit :
1 | nano /etc/apt/sources.list |
Syntax of what will be added will be like this :
1 | deb http://ppa.launchpad.net/nginx/stable/ubuntu quantal main |
for Stable. For dev, stable
in the url will become development
:
1 | deb http://ppa.launchpad.net/nginx/development/ubuntu quantal main |
URL part is :
1 | http://ppa.launchpad.net/nginx/development/ubuntu |
browse-able. After adding, save it.
Now, a key is required to tell “well, its fine”. How the keys are named, is written here :
1 | https://wiki.ubuntu.com/DevelopmentCodeNames |
For example, details will be on the specific version’s Wiki :
1 | https://wiki.ubuntu.com/TrustyTahr/ReleaseSchedule |
The genuine method to add this key is in this way :
1 2 3 4 | wget -c -O- http://nginx.org/keys/nginx_signing.key | sudo apt-key add - echo "deb http://nginx.org/packages/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list > /dev/null echo "deb-src http://nginx.org/packages/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list > /dev/null apt-get update -y |
and run apt-get update -y
. This makes 100% sure that you are not adding a tracking software along with it. Most of you do this :
1 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C |
You must search what C300EE8C
is. It is this :
1 | http://keyserver.ubuntu.com:11371/pks/lookup?op=vindex&search=0x00A6F0A3C300EE8C |
Self Signed cert. The person is good. But you can see, it is not signed by using a code signing certificate by GeoTrust or any certifying authority. Most of you haphazardly run commands without a plan. We refer CSS Tricks
, Perishable Press
like websites. Why? Because we know the owners! We will never recommend labnol.org
. Whether the webmaster is good or bad does not matter. We can not see the source code or certifying authority has not checked. Unknowingly a malware can be inside of a closed source software.
We added Launchpad’s repo, not of Nginx :
1 | http://nginx.org/packages/mainline/ubuntu/ |
Why? because if Launchpad gets hacked, it will be a bigger news than Nginx repo. Possibility of getting informed faster is more. Debian is little bit different, we cannot use add-apt-repository ppa:nginx/development
command since it is Ubuntu specific utility that comes along in the python-software-properties packages. That is why we ran apt-get install python-software-properties
command. Otherwise why we will install Python materials!