InstallingFromDebianRepositories

Installing recent versions from Debian Repositories (testing and sid)
This assumes you're running Debian 5.0 codename 'Lenny'. The current stable release.

The nginx version in Lenny is quite outdated: instead of creating your own package, the best solution is to apt pin the nginx package in order to use the testing version as opposed to the stable version. As an added bonus you'll usually also get a more recent version of OpenSSL.

Currently the Nginx debian package in the  respository is 0.7.67, and in   (unstable) also 0.7.67, albeit with a more recent Debian package.

Edit the  file. If you don't have it then create it. Now add to it:

Package: nginx Pin: release a=testing Pin-Priority: 1000

This will make  prefer to install nginx from testing, while trying to solve all its dependencies using packages from   first and fetching them from   if necessary.

Off course, you will need to add the  repositories to your sources list:. Add the lines:

deb http://ftp.debian.org/debian/ testing main contrib deb-src http://ftp.debian.org/debian/ testing main contrib

Please use the Debian mirror nearest to your location for the repositories.

Next, tell apt or aptitude to update the package list:

or

Now you're all set. Grab the nginx package from testing.

or. If you're running a previous version of nginx then when you can run upgrade instead of install. It will fetch all new packages, including a brand new nginx package from the testing release.

If everything goes smoothly you should have a new nginx version installed and running. If something goes wrong and you're upgrading from a previous release then check for changes in the configuration between the previous and the currently installed version of nginx as the probable cause of problems.