Creating a zip archive under linux that is windows compatible

zip -9 -y -r -q file.zip folder/

-9 Indicates the slowest compression speed (optimal compression, ignores the suffix list)
-y Store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link
-r Travel the directory structure recursively
-q Quiet mode
folder Refers to the folder to be zipped

zip package needs to firstly be installed:

sudo apt-get install zip

Install / upgrade to latest Nginx without compiling from source

Nginx server update without compiling

You can install the Nginx package from the regular Ubuntu/Debian repositories, but the versions there are generally lagging behind the current stable/development releases.

In this post, I’ll show you how to install/upgrade the latest stable or development version through Ubuntu’s package manager without having to compile Nginx from source!

1. Ubuntu guide:

1.1 Switch to root:

 sudo -i 

1.2 Update your local list of packages:

 apt-get update

1.3 Install the python-software-properties package:

 apt-get install python-software-properties

1.4 Add the Nginx Launchpad Repository:

1.4.1 Option 1 (the easy way using add-apt-repository):

 add-apt-repository ppa:nginx/development

or if you want the latest stable release use

 add-apt-repository ppa:nginx/stable

1.4.2 Option 2:

1.4.2.1 Add the repository to your sources.list using the following command:

 echo "deb http://ppa.launchpad.net/nginx/development/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list

or if you want the latest stable release use

 echo "deb http://ppa.launchpad.net/nginx/release/ubuntu $(lsb_release -cs) main" >> /etc/apt/sources.list

Note: lsb_release -cs will grab your current ubuntu install codename

1.4.2.2 get and add the repository public key:

 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C

1.5 Update your local list of packages again:

 sudo apt-get update

1.6 Check current Nginx version:

 nginx -v
nginx version: nginx/1.2.4

1.7 Now, you can install (actually upgrade) the latest version of Nginx just like any other package (we must use forced install otherwise it will fail):

1.7.1 To upgrade:

 apt-get upgrade nginx -f

When asked what to do with the Nginx configuration file /etc/nginx/nginx.conf select
N in orer to keep your current Nginx configuration file.

1.7.2 To install (if not performing an upgrade):

 apt-get install nginx -f

1.8 When the install is done, check your current version of nginx:

 nginx -v

It should read: nginx version: nginx/1.3.8

1.9 Now just to be on the safe side and make sure everything is ok, restart the nginx service followed by a reload of the configuration to make sure statuses are OK:

 service nginx restart
service nginx reload

You are done!
Things on Debian are a little bit different since we cannot use the add-apt-repository ppa:nginx/development command since add-apt-repository is a Ubuntu specific utility that comes along in the python-software-properties packages, however since nginx isn’t all that different for Debian from Ubuntu, we can use Ubuntu development repositories to install the nginx development version bu manually modifying the sources.list file.

2.1 Switch to root:

 sudo -i

2.2 Open for edit your sources.list repositories:

 nano /etc/apt/sources.list

2.3 And add the following line at the bottom of the file:

 deb http://ppa.launchpad.net/nginx/development/ubuntu lucid main

Note: for latest stable version use

 deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main

or

 deb http://ppa.launchpad.net/nginx/development/ubuntu quantal main

Note: for latest stable version use

 deb http://ppa.launchpad.net/nginx/stable/ubuntu quantal main

Note: check out ubuntu develoment codenames here if you want to use others: https://wiki.ubuntu.com/DevelopmentCodeNames if you’d like to use a different ubuntu version repository.

2.3 Next, download and add the repository private key:

  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C

2.4 Update your local list of packages:

 apt-get update

2.5 Check current Nginx version:

 nginx -v
nginx version: nginx/1.2.8

2.6 Perform the Nginx webserver upgrade (use forced version):

2.6.1 To upgrade:

 apt-get upgrade nginx -f

When asked what to do with the Nginx configuration file /etc/nginx/nginx.conf select
N in order to keep your current Nginx configuration file.

2.6.2 To install (if not performing an upgrade):

 apt-get install nginx -f

2.7 When the install is done, check your current version of Nginx:

 nginx -v
It should read: nginx version: nginx/1.3.8

2.8 Now just to be on the safe side and make sure everything is ok, restart the Nginx service followed by a reload of the configuration to make sure statuses are OK:

 service nginx restart
service nginx reload

You are done!

3. Now to see the status of your current services type in the following:

 service --status-all

Guide tested on:

Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:        12.10
Codename:       quantal

  AND

Distributor ID: Debian
Description:    Debian GNU/Linux 6.0.6 (squeeze)
Release:        6.0.6
Codename:       squeeze

Post inspired from Clay Richardson.