Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
centos:web_c7:apache_4 [07.08.2017 20:22. ] – [www.conf (Pools)] djangocentos:web_c7:apache_4 [07.08.2017 20:54. ] – [PHP Info bei Verwendung von mod_php] django
Zeile 1391: Zeile 1391:
    # systemctl restart httpd.service    # systemctl restart httpd.service
  
 +Den erfolgreichen Neustart des Webservers können wir nun auch abfragen.
 +   # systemctl status httpd.service 
  
 +<html><pre class="code">
 +<font style="color: rgb(29, 180, 29)"><b>●</b></font> httpd.service - The Apache HTTP Server
 +   Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
 +   Active: <font style="color: rgb(29, 180, 29)"><b>active (running) since</b></font> Mon 2017-08-07 22:21:37 CEST; 2min 41s ago
 +     Docs: man:httpd(8)
 +           man:apachectl(8)
 +  Process: 9894 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
 +  Process: 12446 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 + Main PID: 9898 (httpd)
 +   Status: "Total requests: 39; Current requests/sec: 0.2; Current traffic: 614 B/sec"
 +   CGroup: /system.slice/httpd.service
 +           ├─9898 /usr/sbin/httpd -DFOREGROUND
 +           ├─9899 /usr/sbin/httpd -DFOREGROUND
 +           ├─9900 /usr/sbin/httpd -DFOREGROUND
 +           ├─9901 /usr/sbin/httpd -DFOREGROUND
 +           ├─9904 /usr/sbin/httpd -DFOREGROUND
 +           └─9985 /usr/sbin/httpd -DFOREGROUND
  
-Anschließend starten wir den +Aug 07 22:21:37 vml000107.dmz.nausch.org systemd[1]: Starting The Apache HTTP Server... 
 +Aug 07 22:21:37 vml000107.dmz.nausch.org systemd[1]: Started The Apache HTTP Server.</font></pre> 
 +</html>
  
 +Anschließend starten wir den **PHP-FPM**-Daemon einmal durch.
 +   # systemctl restart php-fpm.service
  
 +Auch hier können wir den erfolgreichen Restart abfragen.
  
  
-==== PHP Info bei Verwendung von mod_php ====+<html><pre class="code"> 
 +<font style="color: rgb(29, 180, 29)"><b>●</b></font> php-fpm.service - The PHP FastCGI Process Manager 
 +   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled) 
 +   Active: <font style="color: rgb(29, 180, 29)"><b>active (running) since</b></font> Mon 2017-08-07 22:28:33 CEST; 44s ago 
 + Main PID: 10260 (php-fpm) 
 +   Status: "Processes active: 1, idle: 15, Requests: 6, slow: 0, Traffic: 0.2req/sec" 
 +   CGroup: /system.slice/php-fpm.service 
 +           ├─10260 php-fpm: master process (/etc/php-fpm.conf) 
 +           ├─10261 php-fpm: pool fpm 
 +           ├─10262 php-fpm: pool fpm 
 +           ├─10263 php-fpm: pool fpm 
 +           ├─10264 php-fpm: pool fpm 
 +           ├─10265 php-fpm: pool fpm 
 +           ├─10266 php-fpm: pool nextcloud 
 +           ├─10267 php-fpm: pool nextcloud 
 +           ├─10268 php-fpm: pool nextcloud 
 +           ├─10269 php-fpm: pool nextcloud 
 +           ├─10270 php-fpm: pool nextcloud 
 +           ├─10271 php-fpm: pool www 
 +           ├─10272 php-fpm: pool www 
 +           ├─10273 php-fpm: pool www 
 +           ├─10274 php-fpm: pool www 
 +           ├─10275 php-fpm: pool www 
 +           ├─10276 php-fpm: pool nextcloud 
 +           └─10290 php-fpm: pool fpm
  
 +Aug 07 22:28:33 vml000107.dmz.nausch.org systemd[1]: Starting The PHP FastCGI Process Manager...
 +Aug 07 22:28:33 vml000107.dmz.nausch.org systemd[1]: Started The PHP FastCGI Process Manager.</font></pre>
 +</html>
 +
 +Alternativ dazu kann auch mit nachfolgendem Befehlsaufruf überprüft werden welche Prozesse mit den zugehörigen Pools gestartet wurden.
 +   # ps auxwwwf | grep php
 +<code>root     10331  0.0  0.0 112644   928 pts/0    S+   22:31   0:00                      \_ grep --color=auto php
 +root     10260  0.0  0.7 466980 30676 ?        Ss   22:28   0:00 php-fpm: master process (/etc/php-fpm.conf)
 +php-fpm  10261  0.2  0.7 559724 30696 ?        S    22:28   0:00  \_ php-fpm: pool fpm
 +php-fpm  10262  0.0  0.5 467528 20792 ?        S    22:28   0:00  \_ php-fpm: pool fpm
 +php-fpm  10263  0.0  0.4 467520 17476 ?        S    22:28   0:00  \_ php-fpm: pool fpm
 +php-fpm  10264  0.0  0.1 466860  6996 ?        S    22:28   0:00  \_ php-fpm: pool fpm
 +php-fpm  10265  0.0  0.1 466860  7000 ?        S    22:28   0:00  \_ php-fpm: pool fpm
 +apache   10266  0.5  0.7 471888 30596 ?        S    22:28   0:00  \_ php-fpm: pool nextcloud
 +apache   10267  0.4  0.6 471832 27628 ?        S    22:28   0:00  \_ php-fpm: pool nextcloud
 +apache   10268  0.3  0.7 473876 29936 ?        S    22:28   0:00  \_ php-fpm: pool nextcloud
 +apache   10269  0.3  0.5 469780 22724 ?        S    22:28   0:00  \_ php-fpm: pool nextcloud
 +apache   10270  0.1  0.6 471836 27720 ?        S    22:28   0:00  \_ php-fpm: pool nextcloud
 +apache   10271  0.0  0.1 466860  6996 ?        S    22:28   0:00  \_ php-fpm: pool www
 +apache   10272  0.0  0.1 466860  6996 ?        S    22:28   0:00  \_ php-fpm: pool www
 +apache   10273  0.0  0.1 466860  6996 ?        S    22:28   0:00  \_ php-fpm: pool www
 +apache   10274  0.0  0.1 466860  6996 ?        S    22:28   0:00  \_ php-fpm: pool www
 +apache   10275  0.0  0.1 466860  7000 ?        S    22:28   0:00  \_ php-fpm: pool www
 +apache   10276  0.3  0.6 471828 26136 ?        S    22:28   0:00  \_ php-fpm: pool nextcloud
 +php-fpm  10290  0.0  0.1 466860  7012 ?        S    22:29   0:00  \_ php-fpm: pool fpm</code>
 +
 +===== Überprüfung der verwendeten PHP-API =====
 +Zum Schluss wollen wir noch prüfen, ob auch wirklich die gewünschte PHP-API sich in Verwendung befindet. Hierzu legen wir eine einfache Textdatei im Document-ROOT unseres Webservers ab und rufen die zugehörige UIR über den Browser unserer Wahl auf.
 +
 +==== PHP Info bei Verwendung von mod_php ====
 +Das erste Beispiel zeigt die Verwendung des **//Apache 2.0 Handlers//** an, der bei Verwendung der originären PHP-Anbindung mit Hilfe von **mod_php** zur Anwendung kommt.
    # echo '<?php phpinfo(); ?>' > /srv/www/html/info.php    # echo '<?php phpinfo(); ?>' > /srv/www/html/info.php
  
Zeile 1408: Zeile 1487:
    # rm /srv/www/html/info.php    # rm /srv/www/html/info.php
  
 +Da die Datei **info.php** nur zu Demozwecken notwendig war, können wir dies nun auch wieder löschen.
 ==== PHP Info bei Verwendung von php-fpm ==== ==== PHP Info bei Verwendung von php-fpm ====
 +Das zweite Beispiel zeigt die erfolgreiche Verwendung des alternativen //**FastCGI Prozess Managers**//: __FPM/FastCGI__. 
    # echo '<?php phpinfo(); ?>' > /srv/www/html/info.php    # echo '<?php phpinfo(); ?>' > /srv/www/html/info.php
  
Zeile 1415: Zeile 1496:
 {{ :centos:web_c7:info-php-fpm.png?nolink&800 |Bild: PHP Info unter Verwendung von php-fpm}} {{ :centos:web_c7:info-php-fpm.png?nolink&800 |Bild: PHP Info unter Verwendung von php-fpm}}
  
 +Da auch hier dies nur ein Demonstrationszweck war, entfernen wir auch hier wieder die zuvor angelegte Testdatei **info.php**.
    # rm /srv/www/html/info.php    # rm /srv/www/html/info.php
  
  • centos/web_c7/apache_4.txt
  • Zuletzt geändert: 22.07.2019 14:57.
  • von 127.0.0.1