Update nginx to the latest version

Discussion in 'Installation/Configuration' started by George321, Jan 26, 2017.

  1. George321

    George321 New Member

    hello,
    i have my server configured like this tutorial here: https://www.howtoforge.com/tutorial/perfect-server-debian-jessie-nginx-bind-dovecot-ispconfig-3.1/

    And now i see that the newest version of nginx is nginx-1.10.2 and i have nginx version: nginx/1.6.2
    I tried these:
    sudo sh -c "echo 'deb http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list"
    $ sudo sh -c "echo 'deb-src http://nginx.org/packages/debian/ `lsb_release -cs` nginx' >> /etc/apt/sources.list"
    $ curl http://nginx.org/keys/nginx_signing.key | apt-key add -
    $ sudo apt-get update

    and then
    sudo apt-get install nginx
    but i get errors http://pastebin.com/d3BQaUH8

    So how i can safely update nginx?
     
  2. xatorik

    xatorik New Member

    Hello, I have the same question.
    I installed latest ISPConfig stable version on Debian 12, however the Nginx seems 2 years old with version: 1.22.1
    There's 1.27.3 version right now, is there any possibility to update nginx within ISPConfig without having any issue?
    Best,
    Mark
     
  3. remkoh

    remkoh Active Member HowtoForge Supporter

    Short answer: no
    The version you've got is the version Debian distributes.

    If you want a newer version you'll have to compile it yourself.
    But doing that requires you to be very precise with all parameters, so that it's installed in exactly the same locations as Debian's package is installed into. And with minimal exactly the same things enabled as the package has.
    Otherwise you most likely will have big troubles with ISPC.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Its not two years old, Nginx gets patched by Debian like any other package and the version number does not get increased. So the Nginx of your system already contains all required security patches, and you get a new Nginx version with each Debian stable release.
     
  5. michelangelo

    michelangelo Active Member


    This is exactly the reason why you should avoid compiling software on a distribution that delivers its software via binary packages.
    Self-compiled and unpacked software is not tracked by the system's package manager and the next time the distribution package gets an update or major version upgrade, it ends up in a mess.

    @xatorik
    Better learn to package the software yourself or find reliable and trustworthy repositories to do it for you.
    In the case of Nginx, you can get newer versions of Nginx directly from the developer. Here is the link: https://nginx.org/en/linux_packages.html

    However, it seems that they only provide the stable versions of Nginx and not the mainline versions, if I have seen this correctly.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can't use them as a direct replacement as they differ from the packages provided by Debian, they run as a user nginx and not www-data. Installing them will break your setup as it messes up server permissions.
     
  7. michelangelo

    michelangelo Active Member

    Now that you mention it I vaguely remember something similar with CentOS back in the days with the Nginx packages, before I started to build and package my own Apache and Nginx versions, but I also may mix it up with something else.

    Anyway, compiling and installing directly from source sucks as I said and I would do that only as a last resort.
     
  8. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Sticking to OS shipped nginx is best but if you truly want to try, I would however suggest the Ondrej Sury nginx stable ppa package which is quite latest and is quite stable to be used with ISPConfig, at least in my limited personal experience.
     
    till likes this.

Share This Page