July 06, 2017 PHP-FPM can listen on multiple sockets. I also listen on Unix sockets, or TCP sockets. See how this works and how to ensure Nginx is properly sending requests to PHP-FPM. PHP-FPM can listen on multiple sockets. I also listen on Unix sockets, or TCP sockets. See how this works and how to ensure Nginx is properly sending requests to PHP-FPM.### Default Configuration Edit PHP-FPM configuration
PHP-FPM Listen configuration:
Also edit Nginx and see where it's sending request to PHP-FPM:
We can see above that Nginx is sending requests to PHP-FPM via a unix socket (faux file) at
Unix SocketsThese are secure in that they are file-based and can't be read by remote servers. We can further use linux permission to set who can read and write to this socket file. Nginx is run as user/group If we change the Unix socket owner to user/group
So, file permissions are the security mechanism for PHP-FPM when using a unix socket. The faux-file's user/group and it's user/group/other permissions determines what local users and processes and read and write to the PHP-FPM socket. TCP SocketsSetting the Listen directive to a TCP socket (ip address and port) makes PHP-FPM listen over the network rather than as a unix socket. This makes PHP-FPM able to be listened to by remote servers (or still locally over the localhost network). Change Listen to PHP-FPM:
Nginx:
Ini bekerja dengan Wordpress 5.1.1 dan yang lebih baru bersama dengan PHP 7.3, FastCGI, proksi, juga MariaDB / MySQL. Diperiksa dua kali di server saya. Bekerja seperti pesona. Pertama di CentOS / Fedora / Red Hat
Edit file ini:
Tempel ini:
Harus memberikan srw-rw-rw-. Atau cara mengatur di Debian / Ubuntu Tutorial: sumber: https://emi.is/?page=articles&article=php-7-installation-and-configuration-for-apache-2.4-using-php-fpm-(debian ,-- repository)
Masalahnya adalah bahwa php 7.3 dari repo Ondrej hanya bekerja dengan mode mpm_prefork. Ia memiliki git repo, jadi Anda dapat menemukannya di internet dan bertanya kepadanya, apakah ia akan membuat php 7.3 untuk mpm_worker dan mpm_event. Konfigurasi lainnya untuk distro keluarga Debian adalah di bawah ini:
pasta
pasta
pasta
salin ini ke file txt:
hapus dan tempel ini alih-alih di atas:
Tambahkan arahan
Kemudian aktifkan situs:
Edit situs SSL berikutnya (Dalam hal ini certbot dari Let's Encrypt telah diinstal dan dikonfigurasi sebelumnya pada awal konfigurasi sertifikat SSL).
Ingatlah untuk menambahkan port 9000 ke firewall di Debian / Ubuntu
Pada CentoOS / Fedora / Red Hat
|