Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:apache_http_server_archlinux_-_php-fpm_-_alternativer_php-interpreter

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
tachtler:apache_http_server_archlinux_-_php-fpm_-_alternativer_php-interpreter [2022/07/01 16:52] – [info-Konfiguration] klaustachtler:apache_http_server_archlinux_-_php-fpm_-_alternativer_php-interpreter [2022/07/01 17:55] (aktuell) – [info-Konfiguration] klaus
Zeile 266: Zeile 266:
  
 Nachfolgende Änderungen sind an dieser Konfigurationsdatei durchzuführen: Nachfolgende Änderungen sind an dieser Konfigurationsdatei durchzuführen:
- 
-**Aktuelle Möglichkeit: __TCP-IP/Port__** 
  
 **(Komplette Konfigurationsdatei)** **(Komplette Konfigurationsdatei)**
Zeile 537: Zeile 535:
 ;   '/path/to/unix/socket' - to listen on a unix socket. ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Default Value: value of the listen option ; Default Value: value of the listen option
-;pm.status_listen = 127.0.0.1:9001+; Tachtler 
 +; default: ;pm.status_listen = 127.0.0.1:9001 
 +pm.status_listen = /run/php-fpm/php-fpm-status.sock
  
 ; The ping URI to call the monitoring page of FPM. If this value is not set, no ; The ping URI to call the monitoring page of FPM. If this value is not set, no
Zeile 746: Zeile 746:
  
 Aktivieren der Statusseite durch setzen des Pfades für den Aufruf! Aktivieren der Statusseite durch setzen des Pfades für den Aufruf!
 +
 +  * <code ini>pm.status_listen = /run/php-fpm/php-fpm-status.sock</code>
 +
 +Konfiguration des **''UNIX''_Sockets** auf dem die [[https://php-fpm.org/|PHP-FPM]]-Status Informationen abgerufen werden können. 
 +
 +:!: **WICHTIG** - **Es __muss__ ein eigener ''UNIX''-Socket definiert werden!**
  
 ==== /etc/php/php-fpm.conf ====  ==== /etc/php/php-fpm.conf ==== 
Zeile 947: Zeile 953:
     * [[tachtler:apache_http_server_archlinux_-_php-fpm_-_alternativer_php-interpreter#etc_php_php-fpmd_wwwconf|Apache HTTP Server ArchLinux - php-fpm - Alternativer PHP-Interpreter - /etc/php/php-fpm.d/www.conf]]     * [[tachtler:apache_http_server_archlinux_-_php-fpm_-_alternativer_php-interpreter#etc_php_php-fpmd_wwwconf|Apache HTTP Server ArchLinux - php-fpm - Alternativer PHP-Interpreter - /etc/php/php-fpm.d/www.conf]]
   * Setzen einer **''Location''** und des entsprechenden **''Handlers''** in der Konfugutrationsdatei   * Setzen einer **''Location''** und des entsprechenden **''Handlers''** in der Konfugutrationsdatei
-    * ''/etc/httpd/conf/extras/httpd-info.conf''+    * ''/etc/httpd/conf/extra/httpd-info.conf''
  
-(**Nur relevanter Ausschnitt**)+==== info-Konfiguration: /etc/httpd/conf/extra/httpd-info.conf ====
  
 +^ Verzeichnis/Name                                  ^ Beschreibung ^
 +| **''/etc/httpd/conf/extra/httpd-info.conf''**  | Beinhaltet Einstellungen zu Statusmeldungen und Informationen des Servers, abrufbar unter speziellen URL-Ergänzungen ''/server-status'', ''/server-info'' und **neu** ''ldap-status'' |
 +
 +++++ /etc/httpd/conf/extra/httpd-info.conf |
 <code apache> <code apache>
-    <Location /php-fpm-status> +
-     SetHandler "proxy:unix:/var/run/php-fpm-www.sock|fcgi://localhost/php-fpm-status" +# Get information about the requests being processed by the server 
-    </Location>+# and the configuration of the server. 
 +
 +# Required modules: mod_authz_core, mod_authz_host, 
 +#                   mod_info (for the server-info handler), 
 +#                   mod_status (for the server-status handler) 
 + 
 +
 +# Allow server status reports generated by mod_status, 
 +# with the URL of http://servername/server-status 
 +# Change the ".example.com" to match your domain to enable. 
 + 
 +<Location /server-status> 
 +    SetHandler server-status 
 +    # Tachtler  
 +    # default: Require host .example.com 
 +    # default: Require ip 127 
 +    Require all granted 
 +</Location> 
 + 
 +
 +# ExtendedStatus controls whether Apache will generate "full" status 
 +# information (ExtendedStatus On) or just basic information (ExtendedStatus 
 +# Off) when the "server-status" handler is called. The default is Off. 
 +
 +# Tachtler 
 +# default: #ExtendedStatus On 
 +ExtendedStatus On 
 +# Tachtler - NEW - 
 +SeeRequestTail On 
 + 
 +
 +# Allow remote server configuration reports, with the URL of 
 +#  http://servername/server-info (requires that mod_info.c be loaded). 
 +# Change the ".example.com" to match your domain to enable. 
 +
 +<Location /server-info> 
 +    SetHandler server-info 
 +    # Tachtler  
 +    # default: Require host .example.com 
 +    # default: Require ip 127 
 +    Require all granted 
 +</Location> 
 + 
 +
 +# Allow LDAP-Cache status reports generated by mod_ldap, 
 +# with the URL of http://servername/ldap-status 
 +# Change the ".example.com" to match your domain to enable. 
 + 
 +<Location /ldap-status> 
 +    SetHandler ldap-status 
 +    Require all granted 
 +</Location> 
 + 
 +
 +# Allow PHP-FPM status reports generated by php-fpm, 
 +# with the URL of http://servername/php-fpm-status 
 +# Change the ".example.com" to match your domain to enable. 
 + 
 +<Location /php-fpm-status> 
 +    SetHandler "proxy:unix:/run/php-fpm/php-fpm-status.sock|fcgi://localhost/php-fpm-status" 
 +    Require all granted     
 +</Location>
 </code> </code>
 +++++
 +
 +**__Erklärungen__**:
 +
 +  * <code apache><Location /php-fpm-status></code>
 +
 +Wendet die enthaltenen Direktiven nur auf die entsprechenden URL an.
 +
 +  * <code apache>SetHandler "proxy:unix:/run/php-fpm/php-fpm-status.sock|fcgi://localhost/php-fpm-status"</code>
 +
 +Erzwingt die Verarbeitung aller passenden Dateien durch den Handler für [[https://php-fpm.org/|PHP-FPM]]-Status.
 +
 +  * <code apache>Require all granted</code>
 +
 +Zugriff auf die URL-Erweiterung ''/php-fpm-status'', **__ohne__** Beschränkungen. \\ Siehe auch nachfolgenden externen Link: [[https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require|Require]]
 +
 +:!: **HINWEIS** - **Der Zugriff auf diese URL-Erweiterung sollte durch eine Zugriffsbeschränkung eingeschränkt werden**
 +
 +Siehe auch nachfolgende internen Links:
 +  * [[tachtler:apache_http_server_archlinux#basic_authentifizierunghtpasswd|Apache HTTP Server ArchLinux - Basic Authentifizierung - Basic Authentifizierung: htpasswd]]
 +  * [[tachtler:apache_http_server_archlinux#digest_authentifizierunghtdigest|Apache HTTP Server ArchLinux - Digest Authentifizierung - Digest Authentifizierung: htdigest]]
 +  * [[tachtler:apache_http_server_archlinux_-_mod_ldap_-_ldap-authentifizierung#ldaps_authentifizierung|Apache HTTP Server ArchLinux - mod_ldap - LDAP-Authentifizierung - LDAPS-Authentifizierung]]
 +
 +  * <code apache></Location></code>
 +
 +Schliesst die Anwendung auf die enthaltenen Direktiven nur auf die entsprechenden URL ab.
 +
 +==== info-Konfiguration: Erster Start - php-fpm ====
 +
 +Falls vorstehende Änderungen (natürlich an die jeweiligen Bedürfnisse angepasst) durchgeführt wurden, sollte ein **erster Start** von [[https://php-fpm.org/|PHP-FPM]] nichts mehr im Wege stehen.
 +
 +Danach kann der **php-fpm**-Server mit nachfolgendem Befehle gestartet werden:
 +<code>
 +# systemctl start php-fpm.service
 +</code>
 +
 +Mit nachfolgendem Befehl kann der Status des  abgefragt werden:
 +<code>
 +# systemctl status php-fpm.service 
 +● php-fpm.service - The PHP FastCGI Process Manager
 +     Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
 +     Active: active (running) since Fri 2022-07-01 17:28:16 CEST; 4s ago
 +   Main PID: 1713 (php-fpm)
 +     Status: "Ready to handle connections"
 +      Tasks: 3 (limit: 7090)
 +     Memory: 5.8M
 +        CPU: 54ms
 +     CGroup: /system.slice/php-fpm.service
 +             ├─1713 "php-fpm: master process (/etc/php/php-fpm.conf)"
 +             ├─1714 "php-fpm: pool www"
 +             └─1715 "php-fpm: pool www"
 +
 +Jul 01 17:28:16 vml030 systemd[1]: Starting The PHP FastCGI Process Manager...
 +Jul 01 17:28:16 vml030 php-fpm[1713]: [NOTICE] fpm is running, pid 1713
 +Jul 01 17:28:16 vml030 php-fpm[1713]: [NOTICE] ready to handle connections
 +Jul 01 17:28:16 vml030 php-fpm[1713]: [NOTICE] systemd monitor interval set to 10000ms
 +Jul 01 17:28:16 vml030 systemd[1]: Started The PHP FastCGI Process Manager.
 +</code>
 +
 +Nachfolgender Befehl kann ebenfalls zur Überprüfung der Lauffähigkeit des **php-fpm**-Servers genutzt werden und zeigt die laufenden Prozesse und deren genutzte "Pool"'s, hier (''pool www''):
 +<code>
 +# ps auxwwwf | grep php
 +root        1719  0.0  0.0   7000  2552 pts/0    S+   17:28   0:00                      \_ grep php
 +root        1713  0.1  0.5  82952 21236 ?        Ss   17:28   0:00 php-fpm: master process
 +(/etc/php/php-fpm.conf)
 +http        1714  0.0  0.1  82948  6860 ?        S    17:28   0:00  \_ php-fpm: pool www
 +http        1715  0.0  0.1  82948  6860 ?        S    17:28   0:00  \_ php-fpm: pool www
 +</code>
 +
 +==== info-Konfiguration: Neustart Apache HTTP Webserver ====
 +
 +Nach den vorangegangenen **Konfigurationsschritten**, sollte einem **Neustart** nichts im Wege stehen:
 +<code>
 +# systemctl restart httpd.service
 +</code>
 +
 +:!: **HINWEIS** - **Es erfolgen __keine__ weiteren Ausgaben, wenn der Start erfolgreich war !**
 +
 +==== info-Konfiguration: Tests ====
 +
 +Wenn ein erneuter Neustart des [[http://httpd.apache.org|Apache HTTP Server]] erfolgreich durchgeführt wurde, können nachfolgende Abfragen mittels eines //Browsers// erfolgen, wie in nachfolgenden Bildern dargestellt durchgeführt werden:
 +
 +Durch anhängen nachfolgenden Zusatzes an die URL: **''/php-fpm-status''**
 +  * [[https://www.apache.tachtler.net/php-fpm-status]]
 +kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
 +
 +{{:tachtler:httpd:archlinux_apache_with_php-fpm_information_php-fpm-status.png|ArchLinux - Apache HTTP Server - Mozilla Firefox - /php-fpm-status}}
 +
 +Durch anhängen nachfolgenden Zusatzes an die URL: **''/php-fpm-status?full''**
 +  * [[https://www.apache.tachtler.net/php-fpm-status?full]]
 +kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
 +
 +{{:tachtler:httpd:archlinux_apache_with_php-fpm_information_php-fpm-status_full.png|ArchLinux - Apache HTTP Server - Mozilla Firefox - /php-fpm-status?full}}
 +
 +Durch anhängen nachfolgenden Zusatzes an die URL: **''/php-fpm-status?html''**
 +  * [[https://www.apache.tachtler.net/php-fpm-status?html]]
 +kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
 +
 +{{:tachtler:httpd:archlinux_apache_with_php-fpm_information_php-fpm-status_html.png|ArchLinux - Apache HTTP Server - Mozilla Firefox - /php-fpm-status?html}}
 +
 +Durch anhängen nachfolgenden Zusatzes an die URL: **''/php-fpm-status?html&full''**
 +  * [[https://www.apache.tachtler.net/php-fpm-status?html&full]]
 +kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
 +
 +{{:tachtler:httpd:archlinux_apache_with_php-fpm_information_php-fpm-status_html_full.png|ArchLinux - Apache HTTP Server - Mozilla Firefox - /php-fpm-status?html&full}}
 +
 +Mit nachfolgendem Befehl, kann eine einfache Datei mit **PHP** Inhalt erzeugt werden, welcher dann die bekannte PHP-Statusseite zur Anzeige bringen sollte. Hier nachfolgendes Beispiel:
 +
 +<code bash>
 +# echo '<?php phpinfo(); ?>' > /srv/http/phpinfo.php 
 +</code>
 +
 +Anschliessend kann diese Datei dann wie folgt über z.B. einen Browser aufgerufen werden, falls dieser entsprechend konfiguriert ist. Eine Ausgabe, wie nachfolgende, sollte erscheinen:
 +  * [[https://www.apache.tachtler.net/phpinfo.php]]
  
 +{{:tachtler:httpd:archlinux_apache_phpinfo_php.png|ArchLinux - Apache HTTP Server - Mozilla Firefox - PHP-Info Abfrage}}
  
-:!: **Hier geht es weiter ... To be continued ...**+:!: **WICHTIG** - **Es __muss__ hier die Anzeige** 
 +  * **Server-API** ''FPM/FastCGI'' 
 +**erscheinen!**
  
tachtler/apache_http_server_archlinux_-_php-fpm_-_alternativer_php-interpreter.1656687173.txt.gz · Zuletzt geändert: 2022/07/01 16:52 von klaus