Jump to content
Froxlor Forum
  • 0

Debian Stretch und libnss-extrausers


hede

Question

Hallo,

ich habe Debian Strecht und nginx mit MariaDB installiert und möchte gern PHP 7 mit FPM ans laufen bekommen.

Das erste Problem, dass ich habe ist, dass die Ausgabe von ls /var/customers/webs nicht die User sondern nur die ID ausgibt.

drwxr-xr-x 5 10000 10000 4096 Nov 10 15:26 web1

Habe alles wie in der Anleitung beschrieben installiert und erhalte auch hier die User:

cat /var/lib/extrausers/passwd
web1:x:10000:10000:Froxlor User:/var/customers/webs/web1/:/bin/false

Nun läuft der Webserver auch trotzdem und ich kann per FTP Dateien hochladen. Allerdings wird der PHP Socket nicht erstellt.

In der vHost steht z.B.

fastcgi_pass unix:/var/run/php/web1-meinedomain.de-php-fpm.socket;

Im Ordner /var/run/php existieren aber nur php7.0-fpm.pid und php7.0-fpm.sock. Im Froxlor Backend habe ich " Verwende libnss-extrausers anstatt libnss-mysql" aktiviert. Cronjobs sind auch eingerichtet.

 

Ich hatte auch mal in der /etc/php/7.0/fpm/pool.d/www.conf folgende Zeile eingefügt "include=/etc/php-fpm.d/*.conf". Ob das richtig ist weiß ich leider nicht. Aber wenn ich dann fpm neustarte erhalte ich folgende Fehler:

ERROR: [pool meinedomain.de] cannot get uid for user 'web1'

Ich vermute es hat mit libnss zu tun. Habt Ihr vielleicht eine Idee?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

Hier meine eruierung zu meinem Fehler 502 Bad Gateway

* Alle pfade mehrmals gecheckt

1. Aktiveren von libnss-extrausers anstatt libnss-mysql unter Systemeinstellungen

2. aktiviere unter einstellungen > Froxlor VirtualHost > Verwende PHP-FPM im Froxlor-Vhost 

3. Gehe zu PHP > PHP-FPM Versionen:
ändere den befehl von "service php7.0-fpm restart" zu "service php7.2-fpm restart"

und den pfad:

"/etc/php/7.0/fpm/pool.d/" zu "/etc/php/7.2/fpm/pool.d/"

4. schreibe zusätzlich noch die configs neu

5. führe den cron aus

danach ist aus die maus mit dem froxlor panel 502 bad gateway > nginx/1.14.0

cron meldet hier schon:
Job for php7.2-fpm.service failed because the control process exited with error code.

 

● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-09-26 17:54:38 CEST; 2min 22s ago
     Docs: man:php-fpm7.2(8)
  Process: 6982 ExecStart=/usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf (code=exited, status=78)
 Main PID: 6982 (code=exited, status=78)

Sep 26 17:54:37 srv.dom.example systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
Sep 26 17:54:38 srv.dom.example php-fpm7.2[6982]: [26-Sep-2018 17:54:38] ERROR: [pool customerdomain.example] cannot get uid for user 'customer'
Sep 26 17:54:38 srv.dom.example php-fpm7.2[6982]: [26-Sep-2018 17:54:38] ERROR: FPM initialization failed
Sep 26 17:54:38 srv.dom.example systemd[1]: php7.2-fpm.service: Main process exited, code=exited, status=78/n/a
Sep 26 17:54:38 srv.dom.example systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.
Sep 26 17:54:38 srv.dom.example systemd[1]: php7.2-fpm.service: Unit entered failed state.
Sep 26 17:54:38 srv.dom.example systemd[1]: php7.2-fpm.service: Failed with result 'exit-code'.

Die Hautdomain mit einer html datei "srv.dom.example" und die kundendomain "customerdomain.example" laufen noch.
Jedoch alles was hinten agehängt wird wie z.b. das froxlor panel wo ich zusätzlich durch einen tcp/ip port schlaufe nicht.

Nginx status sieht wie folgt aus:
● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-09-26 15:38:09 CEST; 2h 26min ago
     Docs: http://nginx.org/en/docs/
  Process: 6967 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 706 (nginx)
    Tasks: 5 (limit: 4915)
   CGroup: /system.slice/nginx.service
           ├─ 706 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
           ├─6969 nginx: worker process
           ├─6970 nginx: worker process
           ├─6971 nginx: worker process
           └─6972 nginx: worker process

Sep 26 16:20:01 srv.dom.example systemd[1]: Reloading nginx - high performance web server.
Sep 26 16:20:01 srv.dom.example systemd[1]: Reloaded nginx - high performance web server.
Sep 26 16:50:58 srv.dom.example systemd[1]: Reloading nginx - high performance web server.
Sep 26 16:50:58 srv.dom.example systemd[1]: Reloaded nginx - high performance web server.
Sep 26 16:58:32 srv.dom.example systemd[1]: Reloading nginx - high performance web server.
Sep 26 16:58:32 srv.dom.example systemd[1]: Reloaded nginx - high performance web server.
Sep 26 17:26:22 srv.dom.example systemd[1]: Reloading nginx - high performance web server.
Sep 26 17:26:22 srv.dom.example systemd[1]: Reloaded nginx - high performance web server.
Sep 26 17:54:37 srv.dom.example systemd[1]: Reloading nginx - high performance web server.
Sep 26 17:54:37 srv.dom.example systemd[1]: Reloaded nginx - high performance web server.

hatte am anfange der installation schon ein kleines problem mit den fast cgi params

musste die oberen 3 lines entfernen, da ansonst nginx meldete die seien doppelt:
/bin/nano /etc/nginx/fastcgi_params

fastcgi_connect_timeout 65;
fastcgi_send_timeout    180;
fastcgi_read_timeout    180;

unter /etc/php/7.2/fpm/pool.d sind die konfig dateien der Hautdomain "srv.dom.example.conf" und der Kundendomain customerdomain.example.conf

diese enthalten:
Hauptdomain:

listen.owner = froxlorlocal
listen.group = froxlorlocal
listen.mode = 0660
user = froxlorlocal
group = froxlorlocal

Kundendomain

listen.owner = customer
listen.group = customer
listen.mode = 0660
user = customer
group = customer

Warum nimmt er da den user "customer" ? 
müsste da nicht "www-data" oder "froxlorlocal" sein ?

alias config in froxlor verweist auf /var/www/php-fpm 
dieser enthält aber keine dateien. (wurde von mir erstellt mit chmod 0755 "/var/www/php-fpm")

unter run/php sind nur "php7.1-fpm.sock" & "php7.1-fpm.pid" drin (da stimmt auf jedenfall mal was nicht)
unter konfiguration PHP-FPM (alternative to mod_php) installieren danach sind php7.2-fpm.sock und pid vorhanden.
Das war mein fehler, habe vergessen den fpm in der froxlor konfig zu intallieren. Dachte ich hätte dies schon gemacht bei der php installation, aber dem war nicht so ? 

punkt 1-5 wiederholt resp den cron manuell ausgeführt ergabt zuerst:

root@server:~# php /usr/share/AdminPanel/scripts/froxlor_master_cronjob.php --force
sh: 1: /usr/sbin/repquota: not found
Job for php7.2-fpm.service failed because the control process exited with error code.
See "systemctl status php7.2-fpm.service" and "journalctl -xe" for details.
root@server:~# systemctl status php7.2-fpm.service
● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-09-26 20:28:00 CEST; 46s ago
     Docs: man:php-fpm7.2(8)
  Process: 7807 ExecStart=/usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf (code=exited, status=78)
 Main PID: 7807 (code=exited, status=78)

Sep 26 20:27:59 srv.dom.example systemd[1]: Starting The PHP 7.2 FastCGI Process Manager...
Sep 26 20:28:00 srv.dom.example php-fpm7.2[7807]: [26-Sep-2018 20:28:00] ERROR: [pool customerdomain.example] cannot get uid for user 'customer'
Sep 26 20:28:00 srv.dom.example php-fpm7.2[7807]: [26-Sep-2018 20:28:00] ERROR: FPM initialization failed
Sep 26 20:28:00 srv.dom.example systemd[1]: php7.2-fpm.service: Main process exited, code=exited, status=78/n/a
Sep 26 20:28:00 srv.dom.example systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.
Sep 26 20:28:00 srv.dom.example systemd[1]: php7.2-fpm.service: Unit entered failed state.
Sep 26 20:28:00 srv.dom.example systemd[1]: php7.2-fpm.service: Failed with result 'exit-code'.
root@server:~# systemctl status nginx
● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-09-26 15:38:09 CEST; 4h 51min ago
     Docs: http://nginx.org/en/docs/
  Process: 7792 ExecReload=/bin/kill -s HUP $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 706 (nginx)
    Tasks: 5 (limit: 4915)
   CGroup: /system.slice/nginx.service
           ├─ 706 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
           ├─7796 nginx: worker process
           ├─7797 nginx: worker process
           ├─7798 nginx: worker process
           └─7799 nginx: worker process

Ich dachte mir verdammt und hab dann aus jux den cron nochmals gestartet...

und siehe da:

root@server:~# php /usr/share/AdminPanel/scripts/froxlor_master_cronjob.php --force
root@server:~# systemctl status php7.2-fpm.service
● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-09-26 20:29:55 CEST; 1min 41s ago
     Docs: man:php-fpm7.2(8)
 Main PID: 7891 (php-fpm7.2)
   Status: "Processes active: 0, idle: 2, Requests: 7, slow: 0, Traffic: 0req/sec"
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/php7.2-fpm.service
           ├─7891 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
           ├─7892 php-fpm: pool customerdomain.example
           └─7893 php-fpm: pool srv.dom.example

scheint nun zu funktionieren, hatte da meine schwierigkeiten und dachte ich poste das mal hier als hint.

Link to comment
Share on other sites

ok das hat mich irritiert  

cannot get uid for user 'customer'

da dies als fehler angezeigt wurde, deshalb dachte ich zuerst es könnte an dem

froxlor localuser oder an der nsswitch.conf liegen.

jedoch waren es die sock und pid datei... man lernt immer wieder was dazu, war meine erste installation mit nginx und fpm

Link to comment
Share on other sites

/etc/nsswitch.conf vergessen anzupassen? Und die PHP-Sockets stimmen schon so, hast du vllt den pfad zu den fpm-pool-configs nicht korrekt gesetzt in den Einstellungen? Bitte nicht davon ausgehen, dass die Defaults 100% passen!!!

Link to comment
Share on other sites

In /etc/nsswitch.conf  steht:

# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
# You should place mysql at the end, so that it is queried after the other mechanisams
#
passwd:         compat mysql
group:          compat mysql
shadow:         compat mysql

hosts:       files dns
networks:    files dns

services:    db files
protocols:   db files
rpc:         db files
ethers:      db files
netmasks:    files
netgroup:    files
bootparams:  files

automount:   files
aliases:     files

Und in den Einstellungen habe ich soweit auch alles angepast:

FastCGI IPC Verzeichnis: /var/run/php/

Pfad zu php-fpm-Konfigurationen: /etc/php-fpm.d/

 

id web1 bringt folgende Ausgabe:
id: ‘web1’: no such user

Link to comment
Share on other sites

joa, nsswitch ist falsch, nach Änderungen in den Einstellungen musst du die Konfigurationsschritte dafür auch noch mal durchgehen, für libnss-extrausers gibt es welche :) die nsswitch.conf muss doch wissen das sie extrausers nutzen soll und nicht mehr mysql

8 minutes ago, hede said:

Pfad zu php-fpm-Konfigurationen: /etc/php-fpm.d/

joa das wird nich passen, wirf mal nen blick in deine php-fpm.conf welcher ordner da inkludiert wird, bei debian meist eher sowas wie /etc/php/7.0/fpm/pool.d/

Link to comment
Share on other sites

Vielen Dank. Habe mir ein paar mal den Konfigurationsschritt angesehen und immer gedacht da hat sich nichts geändert.:unsure:.

Der Pfad der PHP-Config muss auch "/etc/php/7.0/fpm/pool.d/" heißen. Damit werden jetzt die sockets angelegt und die Ordner Berechtigungen werden richtig gesetzt.

Link to comment
Share on other sites

Jetzt habe ich allerdings ein neues Problem und ich kann das Froxlor Backend nicht öffnen, da die "run/php/php7.0-fpm.sock" fehlt.

In "/etc/php/7.0/fpm/pool.d" sind jetzt nur noch die configs von Froxlor drin und die vorherige www.conf wurde gelöscht. Wenn ich diese per Hand anlege wird wieder eine php7.0-fpm.sock angelegt aber das ist ja nicht sinn der Sache und wird nach jedem Cronjob gelöscht. Im Backend unter einstellungen habe ich beim Webserver den Pfad zu run/php/php7.0-fpm.sock angegeben.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...