Question

apt-get dist-upgrade asked me if I needed to change some files - it never did before now I cant access my websites

Posted June 4, 2018 1.3k views
NginxUbuntu 16.04

I normally try to keep my server updated and this link always give me error free upgrade and instal apart from today.

Here is what I got asked and I took the no changing route and it has broken my sites. The files were the sites-available with the server blocks. So it sounds like nginx changes something drastic…

Setting up nginx-common (1.13.12-1+ubuntu16.04.1+deb.sury.org+1) ...

Configuration file '/etc/nginx/nginx.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** nginx.conf (Y/I/N/O/D/Z) [default=N] ? N

Configuration file '/etc/nginx/sites-available/default'
 ==> Deleted (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** default (Y/I/N/O/D/Z) [default=N] ? N
Removing obsolete conffile /etc/init/nginx.conf ...

I am a bit lost. Should I take this opportunity to upgrade Ubuntu? I don’t want to complicate things so just getting it working would be great. Thanks for any help.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

I was trying to upgrade to php 7.2 and was tolde to use this…then I got deviated by the warning.

add-apt-repository ppa:ondrej/php
 Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.

Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see 
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it
^CTraceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 143, in <module>
    sys.stdin.readline()
KeyboardInterrupt
root@landed:~# add-apt-repository ppa:ondrej/nginx-mainline
 This branch follows latest NGINX Mainline packages compiled against OpenSSL 1.0.2 for HTTP/2 support with ALPN.

BUGS&FEATURES: This PPA now has a issue tracker: https://deb.sury.org/#bug-reporting

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating: https://donate.sury.org
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/nginx-mainline
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpa7uxzxir/secring.gpg' created
gpg: keyring `/tmp/tmpa7uxzxir/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpa7uxzxir/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
root@landed:~# apt-get update

Have I messed up nginx with doing this, 3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

I chose nginx-mainline

I did not switch the nginx php locations and they will have changed from /run/php/php7.0-fpm-style-review.sock; So I will try that first, be careful if you use nginx and apply fixes and tuts from apache based solutions.

  • Yes 2 sites almost recovered (some issues with php7.2 deprecation) and one site that is using a socket still not working. I think php configuration might be slightly different. What was working was
    fastcgi_pass unix:/run/php/php5-fpm-style-review.sock;

    There is no file there now /run/php/ is empty so I can’t copy stuff across. Have tried simply
    fastcgi_pass unix:/run/php/php7.2-fpm-style-review.sock;

    Alas this is the last piece of the puzzle.

    • fastcgi_pass unix:/run/php/php7.2-fpm.sock;

      works but that’s not secure according to the server hardening of php tutorials and the whole point of a separate pool for each site..

Submit an Answer