Jump to content
Froxlor Forum
  • 0

503 Fehler PHP-FPM, keine Logeinträge?


Shockdoc1

Question

Hi zusammen,

bin gerade etwas am verzweifeln ;)

Habe PHP7.4-FPM laufen und alles funktioniert wunderbar. Auf einer Domain bekomme ich egal bei welcher Datei (selbst bei einer leeren .php Datei oder phpinfo() Datei) einen 503 Fehler:
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Komischerweise gibt es keine Logeinträge. Habe sowohl PHP-FPM als auch Apache2 log level auf notice. Bei einer anderen Domain bekomme ich den Fehler bei Scripten mit wirklich langer Laufzeit (ca. 10 Minuten). Wie kann man die Ressourcen erweitern? Habe bereits 50 Child Prozesse bei einem nicht sonderlich stark beanspruchten Server.

Hat einer eine Idee wie ich den Fehler finden kann?

Komischerweise wird auch unter other_vhosts_acces.log nur der froxlor vhost geloggt, aber alle anderen nicht?

Viele Grüße
Tobi

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

50 child Prozesse? Viel zu viel wenn das ne Standard Kiste ist, je nach eingestelltem prozess-manager reichen da 3-5 locker aus für den normal gebrauch (das Forum hier hat auch max children 5). Läuft denn auch der korrekte Fpm Dienst und sind die in den Webserver vhosts angegebenen Socket Dateien vorhanden? 503 deutet in den meisten Fällen darauf hin, dass der Webserver den PHP Prozess schlichtweg nicht erreichen kann weil er nicht da ist.

Link to comment
Share on other sites

  • 0

Hey d00p,
Danke für die super schnelle Antwort!

Habe mich auf die Anleitungen gehalten, die man so im Internet findet. Kann man runter setzen, den Fehler gab's aber auch bei 1 und 5 Child Prozessen.
Werde ich anpassen :)

Der korrekte FPM Dienst läuft.

Habe jetzt die Logs unter /var/customers/logs gefunden. Dort steht:
No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/lib/apache2/fastcgi/1-domain.php-fpm.socket (*) failed
AH01079: failed to make connection to backend: httpd-UDS

Die Socket file gibt es nicht, keine Ahnung warum nur für die Domain (alle anderen Sockets liegen unter /var/lib/apache2/fastcgi)?

Link to comment
Share on other sites

  • 0

Du sollst ja auch nicht manuell in den Configs rumpfuschen - wenn die Einstellungen alle korrekt sind, erstellt er auch korrekte configs.

6 minutes ago, Shockdoc1 said:

Aus welchen Einstellungen speist sich denn der Cronjob für das setzen von "listen" in der pool.d und "SetHandler" im vhost?

listen und sethandler socket-datei wird von ein und der selben quelle gespeist.

Einstellungen -> FPM Einstellungen -> FastCGI IPC directory
The directory where the php-fpm sockets will be stored by the webserver.
This directory has to be readable for the webserver

Zusammengesetzt wird das Socket dann aus: [fastcgi-ipc-directory]/[fpm-config-id]-[loginname]-[domain]-php-fpm.socket

Das ist für alle Domains gleich. Hast du ggfls für diese eine Domain die nicht geht eine andere FPM config ausgewählt als die anderen die nicht korrekt konfiguriert ist? Anders könnte ich es mir jetzt ohne weitere Info nicht erklären

Link to comment
Share on other sites

  • 0

Also in den vhost trägt er folgenden Socket ein: "1-user-domain.de-php-fpm.socket"

In die pool.d config der Domain trägt er aber "1-froxlor.panel-domain.de-php-fpm.socket" ein.

Ich habe nur zwei PHP Konfigurationen und alle öffentlichen Domains nutzen die gleiche Konfiguration.

Link to comment
Share on other sites

  • 0

hä? das eine ist ja wohl offensichtlich das socket der froxlor-domain und das andere wohl das der kunden-domain. Sorry, ich kann dir da nicht mehr so ganz folgen was du tust. Poste bitte mal die entsprechenden vhosts und pool configs und screenshots der fpm-configs und fpm-daemons

Link to comment
Share on other sites

  • 0

Zur Erklärung:
Der User heißt domains
Die Domain habe ich in xxx.de umbenannt

Kann es ein Problem sein, wenn die Froxlor und die Kundendomain die gleiche ist? Froxlor ist über xxx.de/froxlor erreichbar. Die domain xxx.de ist dem Kunden domains zugeordnet

pool.d

;PHP-FPM configuration for "xxx.de" created on 2020.09.01 20:51:16
[xxx.de]
listen = /var/lib/apache2/fastcgi/1-froxlor.panel-xxx.de-php-fpm.socket
listen.owner = froxlorlocal
listen.group = froxlorlocal
listen.mode = 0660
user = froxlorlocal
group = froxlorlocal
pm = dynamic
pm.max_children = 10
pm.start_servers = 8
pm.min_spare_servers = 4
pm.max_spare_servers = 8
pm.max_requests = 500
;chroot = /var/www/froxlor/
security.limit_extensions = .php
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /var/customers/tmp/froxlor.panel/
env[TMPDIR] = /var/customers/tmp/froxlor.panel/
env[TEMP] = /var/customers/tmp/froxlor.panel/
php_admin_value[session.save_path] = /var/customers/tmp/froxlor.panel/
php_admin_value[upload_tmp_dir] = /var/customers/tmp/froxlor.panel/

vhost ipandport:80

<VirtualHost x.x.x.x:80>
DocumentRoot "/var/www"
 ServerName xxx.de
# temp. disabled ssl-redirect due to Let's Encrypt certificate generation.
  <FilesMatch \.(php)$>
  SetHandler proxy:unix:/var/lib/apache2/fastcgi/1-froxlor.panel-xxx.de-php-fpm.socket|fcgi://localhost
  </FilesMatch>
</VirtualHost>

vhost ipandport:443

Listen x.x.x.x:443
# no ssl-certificate was specified for this domain, therefore no explicit vhost-container is being generated

--> sollte im ssl vhost nicht auch was drin stehen?

vhost domain.de

# 35_froxlor_normal_vhost_xxx.de.conf
# Created 01.09.2020 20:51
# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.

# Domain ID: 3 - CustomerID: 2 - CustomerLogin: domains
<VirtualHost x.x.x.x:80>
  ServerName xxx.de
  ServerAlias www.xxx.de
  ServerAdmin email
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [R=301;L,NE]
  </IfModule>
  <IfModule !mod_rewrite.c>
    Redirect 301 / https://xxx.de/
  </IfModule>
</VirtualHost>

vhost domain.de SSL

# 35_froxlor_ssl_vhost_xxx.de.conf
# Created 01.09.2020 20:51
# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.

# Domain ID: 3 (SSL) - CustomerID: 2 - CustomerLogin: domains
<VirtualHost x.x.x.x:443>
  ServerName xxx.de
  ServerAlias www.xxx.de
  ServerAdmin email
  SSLEngine On
  SSLProtocol -ALL +TLSv1 +TLSv1.2 +TLSv1.3
  Protocols h2 http/1.1
  SSLCompression Off
  SSLHonorCipherOrder off
  SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA3$
  SSLVerifyDepth 10
  SSLCertificateFile /etc/ssl/froxlor-custom/xxx.de.crt
  SSLCertificateKeyFile /etc/ssl/froxlor-custom/xxx.de.key
  SSLCACertificateFile /etc/ssl/froxlor-custom/xxx.de_CA.pem
  SSLCertificateChainFile /etc/ssl/froxlor-custom/xxx.de_chain.pem
  <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=0"
  </IfModule>
  DocumentRoot "/var/customers/webs/domains"
  <FilesMatch \.(php)$>
  SetHandler proxy:unix:/var/lib/apache2/fastcgi/1-domains-domain.de-php-fpm.socket|fcgi://localhost
  </FilesMatch>
  <Directory "/var/customers/webs/domains/">
    Require all granted
    AllowOverride All
  </Directory>
  Alias /awstats "/var/customers/webs/domains/awstats/xxx.de"
  Alias /awstats-icon "/usr/share/awstats/icon/"
  LogLevel warn
  ErrorLog "/var/customers/logs/domains-error.log"
  CustomLog "/var/customers/logs/domains-access.log" combined
</VirtualHost>

Froxlor Settings

image.thumb.png.cfe9a5592240ce404af5749323f54763.png

image.thumb.png.a14ba30ba784a85c1b877f4d988b58da.png

image.png.127dd2cfcbcbbaa40d7623417fc63539.png

image.thumb.png.f5631b02a8069d4a9582df59322ff4d8.png

Link to comment
Share on other sites

  • 0

das "sudo" im fpm reload command brauchst du schonmal nicht, der cron läuft als root.

Prüfe deine IPs und Ports ob dort "Create vHost Container" auf "yes" steht.

Und wenn du genau liest, steht da genau wieso in den ip-vhosts sonst nichts drin ist. Offenbar hast du da wohl probleme mit dem lets encrypt zertifikat oder es gerade erst aktiviert.

Hast du denn erst später von mod_php auf fpm gewechselt? Bist du auch alle Konfigurationsanweisungen für die Dienste korrekt durchgegangen? Ich kann wie gesagt nur raten - ich weiss ja nicht was du da alles mit der kiste gemacht hast

Link to comment
Share on other sites

  • 0

Ja habe erst jetzt auf php-fpm gewechselt und dabei hat alles funktioniert nur wie gesagt die eine Domain nicht. Ich glaube auch mittlerweile dass es an einem SSL Zertifikat liegt.

vHost-Container steht auf ja. Habe gerade gesehen, dass der Cronjob folgenden Fehler auswirft

[debug] System certificate file "" does not seem to exist. Disabling SSL-vhost for "xxx.de"
[error] xxx.de :: empty certificate file! Cannot create ssl-directives

Wie kann denn aber die certificate file leer sein, wenn ich das Zertifikat mit lets encrypt erstelle?

Link to comment
Share on other sites

  • 0

In dem er keines ausstellen kann? Offenbar hast Du den cron ja mit --debug gestartet, da sollte ja dann noch mehr an Info stehen, wenn du immer nur so kleine Häppchen postest ist es nicht unwahrscheinlich daß die eigentliche Ursache nicht gefunden wird weil etwas übersehen wird was dir vllt nicht auffällt

Link to comment
Share on other sites

  • 0

Es ist ehrlichweise für mich gar nicht so leicht zu identifizieren welche Informationen relevant sind 😕

Hier der komplette Output vom Cronjob.

[information] TasksCron: Searching for tasks to do
[information] TasksCron: Task10 started - setting filesystem quota
[information] Task4 started - Rebuilding froxlor_bind.conf
[information] Cleaning dns zone files from /etc/bind/domains/
[debug] domId    domain                                  ismainbutsubto parent domain                           list of child domain ids
[debug] 20       domain-a.com                       0              -
[debug] 19       domain-a.de                        0              -
[debug] 2        domain-b.com                        0              -                                       17
[debug] 7        domain-b.de                         0              -
[debug] 8        domain-c.de                          0              -
[debug] 17       owners.domain-b.com                 2              domain-b.com
[debug] 11       domain-d.io                        0              -
[debug] 3        xxx.de                            0              -
[information] `/etc/bind/domains/domain-a.com.zone` written
[debug] Generating dns config for domain-a.com
[information] `/etc/bind/domains/domain-a.de.zone` written
[debug] Generating dns config for domain-a.de
[information] `/etc/bind/domains/domain-b.com.zone` written
[debug] Generating dns config for domain-b.com
[information] `/etc/bind/domains/domain-b.de.zone` written
[debug] Generating dns config for domain-b.de
[information] `/etc/bind/domains/domain-c.de.zone` written
[debug] Generating dns config for domain-c.de
[information] `/etc/bind/domains/domain-d.io.zone` written
[debug] Generating dns config for domain-d.io
[information] `/etc/bind/domains/xxx.de.zone` written
[debug] Generating dns config for xxx.de
[information] froxlor_bind.conf written
[information] Bind daemon reloaded
[information] Task4 finished
[information] Running Let's Encrypt cronjob prior to regenerating webserver config files
[information] Checking for LetsEncrypt client upgrades before renewing certificates:
[Tue Sep  1 22:02:38 CEST 2020] Already uptodate!
[Tue Sep  1 22:02:38 CEST 2020] Upgrade success!
[Tue Sep  1 22:02:38 CEST 2020] Installing cron job
1 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null
[information] Updated Let's Encrypt certificate for owners.domain-b.com
[information] Updated Let's Encrypt certificate for xxx.de
[information] Updated Let's Encrypt certificate for fotos.xxx.de
[information] Updated Let's Encrypt certificate for domain-d.io
[information] Updated Let's Encrypt certificate for domain-a.de
[information] Let's Encrypt certificates have been updated
[information] apache::createIpPort: creating ip/port settings for  x.x.x.x:80
[debug] x.x.x.x:80 :: inserted vhostcontainer
[information] apache::createIpPort: creating ip/port settings for  x.x.x.x:443
[debug] x.x.x.x:443 :: inserted listen-statement
[debug] System certificate file "" does not seem to exist. Disabling SSL-vhost for "xxx.de"
[error] xxx.de :: empty certificate file! Cannot create ssl-directives
[debug] x.x.x.x:443 :: inserted vhostcontainer
[information] apache::createVirtualHosts: creating vhost container for domain 4, customer domains
[information] apache::createVirtualHosts: creating vhost container for domain 10, customer domains
[information] apache::createVirtualHosts: creating vhost container for domain 5, customer domains
[information] apache::createVirtualHosts: creating vhost container for domain 6, customer domains
[information] apache::createVirtualHosts: creating vhost container for domain 20, customer escape
[information] apache::createVirtualHosts: creating vhost container for domain 19, customer escape
[information] apache::createVirtualHosts: creating vhost container for domain 17, customer domain-c
[information] apache::createVirtualHosts: creating vhost container for domain 11, customer pon
[information] apache::createVirtualHosts: creating vhost container for domain 3, customer domains
[information] apache::createVirtualHosts: creating vhost container for domain 2, customer domain-c
[information] apache::createVirtualHosts: creating vhost container for domain 7, customer domain-c
[information] apache::createVirtualHosts: creating vhost container for domain 8, customer domain-c
[information] apache::writeConfigs: rebuilding /etc/apache2/sites-enabled/
[information] apache::writeConfigs: rebuilding /etc/apache2/htpasswd/
[information] apache::writeConfigs: rebuilding /etc/apache2/sites-enabled/
[information] Froxlor\Cron\Http\ApacheFcgi::reload: running service php7.4-fpm restart
sh: 1: service: not found
[information] Froxlor\Cron\Http\ApacheFcgi::reload: reloading Froxlor\Cron\Http\ApacheFcgi
[notice] Creating passwd file
[notice] Writing 4 entries to passwd file
[notice] Succesfully wrote passwd file
[notice] Creating group file
[notice] Writing 4 entries to group file
[notice] Succesfully wrote group file
[notice] Creating shadow file
[notice] Writing 4 entries to shadow file
[notice] Succesfully wrote shadow file
[notice] Checking system's last guid

Das einzige was mir noch auffällt ist, dass er ohne sudo service jetzt einen Fehler ausspuckt, dass er den service nicht findet. Aber das ist ja nur um php-fpm neuzustarten

Link to comment
Share on other sites

  • 0

Läuft denn der cronjob nicht als root user? Wieso sollte er "Service" nicht finden? Kannst du manuell "service php7.4-fpm restart" Ausführen?

Sorry, aber es wird immer merkwürdiger, keine Ahnung was du da auf dem System gemacht hast 

Link to comment
Share on other sites

  • 0

Ja.

Habs gefunden. Hostname hat auch auf xxx.de gezeigt. Vermutung: Damit konnte er keine SSL Zertifikat für den hostname erstellen, weil das ja schon für die Kundendomain existiert hat.  Sorry das war dumm 😕 

Tausend Dank für deine Hilfe. Ohne dich hab ich es nicht geschafft! Hat mich die ganze Woche schon Stunden gekostet

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...