logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Help to configure php-fpm dual stack
Author
knopfler1980



Joined: 31 Mar 2020
Posts: 4
Location: Spain, Madrid

PostPosted: Tue 31 Mar '20 12:26    Post subject: Help to configure php-fpm dual stack Reply with quote

Server Centos 7 x64
Apache Version Server version: Apache/2.4.6 (CentOS)
Nginx 1.16.1
varnishd (varnish-4.0.5 revision 07eff4c29)
PHP version PHP 7.3.16 (cli)
PHP-FPM 7.3.16
Mysql 5.6.47

Hi all.
I'm installing a server in Google Cloud Platform under always free product.

I found a article where a developer configures a nginx as proxy varnish as cache and apache as webserver. At the moment I have configured apache in 8081 port, in dual stack mode(accepting ipv4 and ipv6 requests) and before starting to create dns with ipv4 and ipv6 records,registering new domain, creating free certificate for it and configure the application infraestructure as I said before, I would like to know if it would be possible to make PHP-FPM run dual-stack as actually does apache because when I configured PHP-FPM I had issues doing it, first I follow these steps https://www.mynotepaper.com/install-latest-php-php-fpm-on-centos-7/ later after see that didn't work follow this spanish instructions https://www.sololinux.es/instalacion-basica-de-php-con-php-fpm-en-centos7/#comment-3220 (main differences between 2 procedures were that with the first link, author configures: /etc/php-fpm.d/www.conf:
/etc/php.ini cgi.fix_pathinfo=0
user = centos
group = centos
listen.owner = centos
listen.group = centos
->and here is where I had issues:
listen = /var/run/php-fpm/php-fpm.sock

The second procedure main difference with the first one is that he configures handler /etc/httpd/conf.d/php.conf using mod_proxy_fcgi added to latest apache version:
SetHandler application/x-httpd-php
SetHandler "proxy:fcgi://127.0.0.1:9000

With this setup server didn't worked until I changed in
/etc/php-fpm.d/www.conf listen = /var/run/php-fpm/php-fpm.sock to listen = 127.0.0.9:9000 . Ok, this is for ipv4, but what happens if a request client comes from ipv6? if request arrives to apache after being processed by nginx,varnish, php-fpm and finally apache, will it work leaving ipv4 setup?

I tried to look for Listen directive in PHP-FPM documentation
https://www.php.net/manual/es/install.fpm.configuration.php
but even the configuration file has more information. Is it possible to add more Listen directives not using pools like in this blog https://symfony.com/doc/current/setup/web_server_configuration.html? In fpm configuration you can configure an arbitrary number of pools, . In a pool you configure either a TCP socket (IP and port) or a Unix domain socket to listen on

And the second fpm part would be adding additional handlers to /etc/httpd/conf.d/php.conf.

I tried to set ipv6 (only ipv6) in both configurations and I was getting a error proxy URI cannot be parsed:0000:0000:0000:0000:0000:0000:0000:0001

Is it possible to configure php-fpm as dual stack?

Thanks in advance and regards.
Back to top
knopfler1980



Joined: 31 Mar 2020
Posts: 4
Location: Spain, Madrid

PostPosted: Fri 03 Apr '20 16:39    Post subject: Re: Help to configure php-fpm dual stack Reply with quote

Well, I was going to set varnish but I read that consumes at least 100MB of RAM as my free server in google cloud platform only has 600MB so I'm going to disable any cache type (all to disk I/O) so I will remove nginx and varnish.

As I didn't find any way to implement ipv6 in php-fpm I will try to set as socket that has several advantages over TCP/IP:
https://blog.guillen.io/2017/03/15/apache-instalar-y-configurar-php-fpm-fastcgi-process-manager/

Thanks anyway for your help
Back to top
knopfler1980



Joined: 31 Mar 2020
Posts: 4
Location: Spain, Madrid

PostPosted: Fri 03 Apr '20 17:14    Post subject: Re: Help to configure php-fpm dual stack Reply with quote

Hi, finally I configured php-fpm to run as unix socket so I will leave apache to handle ipv6 connections which makes easier deploy of web server.

I can run phpinfo.php code and it's working.

Thanks all.
Back to top


Reply to topic   Topic: Help to configure php-fpm dual stack View previous topic :: View next topic
Post new topic   Forum Index -> Other Software