Welcome! Log In Create A New Profile

Advanced

Apache 5.4.7 to PHP-FPM via sockets + patch: DNS lookup failure

Posted by Hans van Eijsden 
Hans van Eijsden
Apache 5.4.7 to PHP-FPM via sockets + patch: DNS lookup failure
January 30, 2014 11:16AM
Hi all,

I would like to have Apache 2.4.7 working with PHP-FPM through Unix sockets.

First of all, I downloaded this patch for Apache
2.4.7: https://issues.apache.org/bugzilla/attachment.cgi?id=31232&action=diff&context=patch&collapsed=&headers=1&format=raw

Then I patched the Apache source code successfully (I think):

/usr/local/src/httpd-2.4.7/modules/proxy# patch < patch247.patch
patching file mod_proxy_balancer.c
patching file proxy_util.c
patching file mod_proxy.c
Hunk #1 succeeded at 1335 (offset -35 lines).
Hunk #2 succeeded at 1409 (offset -35 lines).
Hunk #3 succeeded at 1530 (offset -35 lines).
Hunk #4 succeeded at 1566 (offset -35 lines).
Hunk #5 succeeded at 1578 (offset -35 lines).
Hunk #6 succeeded at 2042 (offset -35 lines).
Hunk #7 succeeded at 2051 (offset -35 lines).
Hunk #8 succeeded at 2066 (offset -35 lines).
Hunk #9 succeeded at 2128 (offset -35 lines).
Hunk #10 succeeded at 2274 (offset -29 lines).
patching file mod_proxy.h
Hunk #1 succeeded at 249 (offset -4 lines).
Hunk #2 succeeded at 342 (offset -4 lines).
Hunk #3 succeeded at 588 (offset -4 lines).

I followed the description
here: https://issues.apache.org/bugzilla/show_bug.cgi?id=54101

After compiling and installing Apache I added this in my httpd-vhosts.conf
(I only have one VirtualHost, so *):

<VirtualHost *>
[...]
<LocationMatch ^(.*\.php)$>
ProxyPass
fcgi://socket=%2fdev%2fshm%2fweblogzwolle-php.sock/home/weblogzwolle/www/
</LocationMatch>
RewriteRule (.*\.php)
fcgi://socket=\%2fdev\%2fshm\%2fweblogzwolle-php.sock/home/weblogzwolle/www/$1
[P,L]
[...]
</VirtualHost>

My PHP-FPM socket is /dev/shm/weblogzwolle-php.sock and my root folder path
is /home/weblogzwolle/www/.

When I visit a .php page, I receive this 502-error in my browser:

*Proxy Error*

*The proxy server received an invalid response from an upstream server.*
*The proxy server could not handle the request GET /index.php.*

*Reason: DNS lookup failure for:
socket=%2fdev%2fshm%2fweblogzwolle-php.sock*

What am I doing wrong? Do you have any ideas? Am I doing something wrong
with that patch?

Thanks!

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Re: Apache 5.4.7 to PHP-FPM via sockets + patch: DNS lookup failure
January 30, 2014 12:51PM
Switch over to nginx, if the problem still exists we might be able to help.
Nikolas Hagelstein
Re: Apache 5.4.7 to PHP-FPM via sockets + patch: DNS lookup failure
February 05, 2014 12:36PM
Hey,

Check out:
http://people.apache.org/~jim/patches/uds-2.4.patch

it states:
" Support for using a Unix Domain Socket is available by using a target
which prepends <code>unix:/path/lis.sock|</code>. For example, to proxy
HTTP and target the UDS at /home/www/socket you would use
<code>unix:/home/www.socket|http://localhost/whatever/</code>.</p>"

Hope this helps,

Nikolas



2014-01-30 Hans van Eijsden <hansheino@gmail.com>:
> Hi all,
>
> I would like to have Apache 2.4.7 working with PHP-FPM through Unix sockets.
>
> First of all, I downloaded this patch for Apache 2.4.7:
> https://issues.apache.org/bugzilla/attachment.cgi?id=31232&action=diff&context=patch&collapsed=&headers=1&format=raw
>
> Then I patched the Apache source code successfully (I think):
>
> /usr/local/src/httpd-2.4.7/modules/proxy# patch < patch247.patch
> patching file mod_proxy_balancer.c
> patching file proxy_util.c
> patching file mod_proxy.c
> Hunk #1 succeeded at 1335 (offset -35 lines).
> Hunk #2 succeeded at 1409 (offset -35 lines).
> Hunk #3 succeeded at 1530 (offset -35 lines).
> Hunk #4 succeeded at 1566 (offset -35 lines).
> Hunk #5 succeeded at 1578 (offset -35 lines).
> Hunk #6 succeeded at 2042 (offset -35 lines).
> Hunk #7 succeeded at 2051 (offset -35 lines).
> Hunk #8 succeeded at 2066 (offset -35 lines).
> Hunk #9 succeeded at 2128 (offset -35 lines).
> Hunk #10 succeeded at 2274 (offset -29 lines).
> patching file mod_proxy.h
> Hunk #1 succeeded at 249 (offset -4 lines).
> Hunk #2 succeeded at 342 (offset -4 lines).
> Hunk #3 succeeded at 588 (offset -4 lines).
>
> I followed the description here:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=54101
>
> After compiling and installing Apache I added this in my httpd-vhosts.conf
> (I only have one VirtualHost, so *):
>
> <VirtualHost *>
> [...]
> <LocationMatch ^(.*\.php)$>
> ProxyPass
> fcgi://socket=%2fdev%2fshm%2fweblogzwolle-php.sock/home/weblogzwolle/www/
> </LocationMatch>
> RewriteRule (.*\.php)
> fcgi://socket=\%2fdev\%2fshm\%2fweblogzwolle-php.sock/home/weblogzwolle/www/$1
> [P,L]
> [...]
> </VirtualHost>
>
> My PHP-FPM socket is /dev/shm/weblogzwolle-php.sock and my root folder path
> is /home/weblogzwolle/www/.
>
> When I visit a .php page, I receive this 502-error in my browser:
>
> Proxy Error
>
> The proxy server received an invalid response from an upstream server.
> The proxy server could not handle the request GET /index.php.
>
> Reason: DNS lookup failure for: socket=%2fdev%2fshm%2fweblogzwolle-php.sock
>
> What am I doing wrong? Do you have any ideas? Am I doing something wrong
> with that patch?
>
> Thanks!
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "highload-php-en" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to highload-php-en+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hans van Eijsden
Re: Apache 5.4.7 to PHP-FPM via sockets + patch: DNS lookup failure
February 22, 2014 08:34PM
Hi all,

First of all, thanks for the replies. I was (and I am) posting via Google
Groups, but I didn't know these were also posting to the nginx forum. So,
while Googling I saw my own message, with more replies than on Google
Groups. One of those replies was a suggestion: "start using nginx".

Nikolas, thanks for your reply. And sorry for being late, I had a lot to
test. In the end, your patch wasn't a reliable solution (because of
mod-rewrite) so I tried Apache 2.4.8 from trunk (sorry for the mistake in
the topic title, Apache 5.4.7 has to be Apache 2.4.7 of course). Apache
from trunk didn't solve it too (some other errors, too much to mention), so
I decided to switch to nginx, as suggested.

Nginx works perfectly great. I love it! So, thanks.

Hans

Op woensdag 5 februari 2014 18:35:36 UTC+1 schreef Nikolas Hagelstein:
>
> Hey,
>
> Check out:
> http://people.apache.org/~jim/patches/uds-2.4.patch
>
> it states:
> " Support for using a Unix Domain Socket is available by using a target
> which prepends <code>unix:/path/lis.sock|</code>. For example, to proxy
> HTTP and target the UDS at /home/www/socket you would use
> <code>unix:/home/www.socket|http://localhost/whatever/</code>.</p>"
>
> Hope this helps,
>
> Nikolas
>
>
>
> 2014-01-30 Hans van Eijsden <hans...@gmail.com <javascript:>>:
> > Hi all,
> >
> > I would like to have Apache 2.4.7 working with PHP-FPM through Unix
> sockets.
> >
> > First of all, I downloaded this patch for Apache 2.4.7:
> >
> https://issues.apache.org/bugzilla/attachment.cgi?id=31232&action=diff&context=patch&collapsed=&headers=1&format=raw
> >
> > Then I patched the Apache source code successfully (I think):
> >
> > /usr/local/src/httpd-2.4.7/modules/proxy# patch < patch247.patch
> > patching file mod_proxy_balancer.c
> > patching file proxy_util.c
> > patching file mod_proxy.c
> > Hunk #1 succeeded at 1335 (offset -35 lines).
> > Hunk #2 succeeded at 1409 (offset -35 lines).
> > Hunk #3 succeeded at 1530 (offset -35 lines).
> > Hunk #4 succeeded at 1566 (offset -35 lines).
> > Hunk #5 succeeded at 1578 (offset -35 lines).
> > Hunk #6 succeeded at 2042 (offset -35 lines).
> > Hunk #7 succeeded at 2051 (offset -35 lines).
> > Hunk #8 succeeded at 2066 (offset -35 lines).
> > Hunk #9 succeeded at 2128 (offset -35 lines).
> > Hunk #10 succeeded at 2274 (offset -29 lines).
> > patching file mod_proxy.h
> > Hunk #1 succeeded at 249 (offset -4 lines).
> > Hunk #2 succeeded at 342 (offset -4 lines).
> > Hunk #3 succeeded at 588 (offset -4 lines).
> >
> > I followed the description here:
> > https://issues.apache.org/bugzilla/show_bug.cgi?id=54101
> >
> > After compiling and installing Apache I added this in my
> httpd-vhosts.conf
> > (I only have one VirtualHost, so *):
> >
> > <VirtualHost *>
> > [...]
> > <LocationMatch ^(.*\.php)$>
> > ProxyPass
> >
> fcgi://socket=%2fdev%2fshm%2fweblogzwolle-php.sock/home/weblogzwolle/www/
> > </LocationMatch>
> > RewriteRule (.*\.php)
> >
> fcgi://socket=\%2fdev\%2fshm\%2fweblogzwolle-php.sock/home/weblogzwolle/www/$1
>
> > [P,L]
> > [...]
> > </VirtualHost>
> >
> > My PHP-FPM socket is /dev/shm/weblogzwolle-php.sock and my root folder
> path
> > is /home/weblogzwolle/www/.
> >
> > When I visit a .php page, I receive this 502-error in my browser:
> >
> > Proxy Error
> >
> > The proxy server received an invalid response from an upstream server.
> > The proxy server could not handle the request GET /index.php.
> >
> > Reason: DNS lookup failure for:
> socket=%2fdev%2fshm%2fweblogzwolle-php.sock
> >
> > What am I doing wrong? Do you have any ideas? Am I doing something wrong
> > with that patch?
> >
> > Thanks!
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google
> Groups
> > "highload-php-en" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to highload-php-...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out.
>

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready