[SOLVED]: After upgrade to ubutnu 20.04 unix:/var/lib/php7.2-fpm/ispconfig.sock failed nginx

Discussion in 'Installation/Configuration' started by minttux, Mar 20, 2021.

  1. minttux

    minttux Member

    Hi my ubuntu was ubuntu 18.04 and isp config 3.1dev and i upgraded to Ubuntu 20.04.2 LTS after that my ispconfig panel doesn't open anymore and i get :
    502 Bad Gateway
    and in nginx log i get:
    and my /etc/nginx/sites-available/ispconfig.vhost is:
    so i checked /var/lib/php7.2-fpm/ispconfig.sock and no such file or directory so i remove all php7.2-fpm and install php7.4 from https://www.howtoforge.com/tutorial...l-pureftpd-bind-postfix-doveot-and-ispconfig/
    my problem didn't solve so i upgrade ispconfig to new version and now is: 3.2.3
    but my problem doesn't solve
    also i i try to install php7.2 but most of package doesn't found and now i have:
    Code:
    root@server:/usr/local/ispconfig# systemctl status php7.2-fpm
    ● php7.2-fpm.service
         Loaded: not-found (Reason: Unit php7.2-fpm.service not found.)
         Active: active (exited) since Fri 2021-03-19 20:31:24 +0330; 13h ago
         CGroup: /system.slice/php7.2-fpm.service
    
    Mar 19 20:31:24 myhost.com systemd[1]: Starting LSB: starts php7.2-fpm...
    Mar 19 20:31:24 myhost.com systemd[1]: Started LSB: starts php7.2-fpm.
    And for php7.4:
    Code:
    root@server:/usr/local/ispconfig# systemctl status php7.4-fpm
    ● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
         Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
         Active: active (running) since Fri 2021-03-19 21:03:27 +0330; 13h ago
           Docs: man:php-fpm7.4(8)
        Process: 111138 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
       Main PID: 108809 (php-fpm7.4)
         Status: "Processes active: 0, idle: 4, Requests: 0, slow: 0, Traffic: 0req/sec"
          Tasks: 5 (limit: 7022)
         Memory: 14.5M
         CGroup: /system.slice/php7.4-fpm.service
                 ├─108809 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
                 ├─111180 php-fpm: pool apps-{fpm_domain}
                 ├─111181 php-fpm: pool apps-{fpm_domain}
                 ├─111182 php-fpm: pool www
                 └─111183 php-fpm: pool www
    
    Mar 19 21:03:27 myhost.com systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
    Mar 19 21:03:27 myhost.com systemd[1]: Started The PHP 7.4 FastCGI Process Manager.
    Mar 19 21:09:01 myhost.com systemd[1]: Reloading The PHP 7.4 FastCGI Process Manager.
    Mar 19 21:09:01 myhost.com systemd[1]: Reloaded The PHP 7.4 FastCGI Process Manager.
    So it's my details of system:
    Code:
    # lsb_release -a
    No LSB modules are available.
    Distributor ID:    Ubuntu
    Description:    Ubuntu 20.04.2 LTS
    Release:    20.04
    Codename:    focal
    
    Nginx: nginx/1.18.0 (Ubuntu)
    Ispconfig: 3.2.3
    PHP: php7.4-fpm
     
    Last edited: Mar 20, 2021
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You must do an ispconfig update after upgrading the OS and let the updater reconfigure the services.

    ispconfig_update.sh --force

    Then login to ISPConfig and adjust the PHP settings to match the new paths for PHP 7.4 under System > server config
     
  3. minttux

    minttux Member

    I did it:
    Code:
    ...
    Reconfigure Services? (yes,no,selected) [yes]:
    Configuring Postfix
    Configuring Dovecot
    Configuring Spamassassin
    Configuring Amavisd
    Configuring Getmail
    Configuring BIND
    Configuring Pureftpd
    Configuring nginx
    Configuring Apps vhost
    Configuring Jailkit
    Configuring Ubuntu Firewall
    Configuring Database
    Updating ISPConfig
    Certificate exists. Not creating a new one.
    Reconfigure Crontab? (yes,no) [yes]:
    Updating Crontab
    Restarting services ...
    Update finished.
    But i get same error when i open ispconfig panel:
    upload_2021-3-20_10-43-11.png
    and same error in log also nothing changed in /etc/nginx/sites-available/ispconfig.vhost and try to load /var/run/php/php7.2-fpm.sock that doesn't exists
     

    Attached Files:

  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Did you follow the perfect server guide for Ubuntu 20.04 to install missing packages and change config where necessary?
     
  5. minttux

    minttux Member

    No i did
    because i only upgrade my ubuntu after that ispconfig broke then i upgrade my ispconfig the problem is php7.4 doesn't detect by ispconfig and upgrade doesn't change anything in ispconfig nginx
    so you offer do this?
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Go through the perfect server guide to install missing packages, then run a force update and let it reconfigure your services.
     
  7. minttux

    minttux Member

  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You can follow that guide, just leave out the Apache packages.
     
  9. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Check your default php. If you have script to keep php7.2 as default, remove it; and/or change update-alternatives to php7.4.

    Others, just follow Ubuntu 20.04 tutorial leaving all apache2 related installs as @Th0m advised and for nginx related installs following the old tutorial for 18.04; that works for me.
     
  10. minttux

    minttux Member

    I did the steps from that tutorial also i moved my /etc/nginx/sites-available/ispconfig.vhost and /etc/nginx/sites-available/apps.vhost somewhere before force update ispconfig it's create only /etc/nginx/sites-available/apps.vhost and not /etc/nginx/sites-available/ispconfig.vhost so i back old /etc/nginx/sites-available/ispconfig.vhost to nginx site but in /var/lib/php7.4-fpm/ only creates apps.sock not ispconfig.sock so in /etc/nginx/sites-available/ispconfig.vhost i changed all
    to
    and when i try to open control panel it shows: File not found. and in nginx error log shows:

    Code:
    2021/03/22 11:08:54 [error] 322344#322344: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 37.254.103.81, server: _, request: "GET /login/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.4-fpm/apps.sock:", host: ...roup.com:9393"
    
    I only have this:
    Code:
    # ls -l /var/lib/php7.4-fpm/
    total 0
    srw-rw---- 1 ispapps ispapps 0 Mar 22 11:06 apps.sock
     
  11. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You shouldn't edit manually for ispconfig.vhost. Try force update ispconfig and reconfigure all services.
     
  12. minttux

    minttux Member

    as i said i tried it many many times also removed isconfig files in nginx directory to regenerate again but no success
     
  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I am sorry to hear that. I have my ubuntu 20.04 server upgraded from 18.04 running nginx web server with ISPConfig panel is working fine by following the same tutorials, so not sure what your problem really is. May be you simply need to follow carefully Pleae read before posting thread and find is your server real fault?
     
  14. minttux

    minttux Member

    it's good to hear you had same steps i can send my server details to your pv and take a look at it if you don't have problem
     
  15. minttux

    minttux Member

    I solved my problem first copy this:
    Code:
    cp /etc/php/7.2/fpm/pool.d/ispconfig.conf /etc/php/7.4/fpm/pool.d/ispconfig.conf
    Then i edit listen (7.2 to 7.4) inside this file:
    Code:
    vim /etc/php/7.4/fpm/pool.d/ispconfig.conf
    And then restart php and nginx then ispconfig control panel was available so i change php version in php setting and Done
    fixed
     
    Hbod likes this.
  16. Hbod

    Hbod Member

    Thanks, @minttux. I just upgraded my Debian 10 to 11 and was struggling with exactly the same issue. ISPConfig does not recreate ispconfig.vhost when you rename or remove it. I had to extract that file from a backup, change the sock, and also copy the ispconfig.conf exactly as you described to get the panel up and running again. In my opinion, it's a bug that ISPConfig does not recreate ispconfig.vhost in case of deletion.
     
  17. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I am not sure why you think your post is related nor do I understand why your ISPConfig is missing its vhost file except if you might have deleted it yourself which is not necessary in any OS version upgrade. In any event you could have missed running ISPConfig update as the last steps while reconfiguring all services which should help too.
     
  18. Hbod

    Hbod Member

    I deleted that file hoping it would be recreated (with correct content) once I ran ispconfig_update.sh --force, but it did not recreate ispconfig.vhost. I didn't miss upgrading the services, etc. My post is related since I had the exact same issues as minttux, which occurred after an OS upgrade, and his steps were the only ones that eventually resolved the issue for me.

    I am running 12 multi server instances and I am very well aware how to upgrade the systems. The machines running Apache did not encounter this issue for me, it's only with nginx.
     
  19. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    This is the obvious mistake which I think none of the tutorials nor credible posts in this forum ever suggested.

    It is clear the wrong on your part, not related to the issues of this thread and not even a bug of ISPConfig.

    No need to brag unnecessarily.
     
  20. Hbod

    Hbod Member

    @ahrasis - I don't know what you are trying to prove here with your attitude, but I did not brag. After upgrading, the ispconfig.vhost file did not update, even though the system was upgraded to PHP7.4 and all of the settings had been adjusted accordingly, following every tutorial. The PHP related stuff was still pointing to the PHP7.3 pool, causing a bad gateway nginx issue for me. That's when I decided to remove the file in the hope that ISPConfig would regenerate it, like it does for apps.vhost and all other files. But it did not recreate the ispconfig.vhost. That's all I was saying, and that's why I was thanking minttux because he had the same issue and found a solution.

    I had backups in case so I could restore that file. But I assume that the host file for ISPConfig should be re-created.
     

Share This Page