Score:0

Why does my socket connection not work?

id flag

I am on Ubuntu 22.04. I have a bit of a non-standard configuration, but I managed to have it running. However there is one thing that does not work: connecting Apache to php-fpm via socket. It works correctly when connecting via TCP/IP.

So this works:

# In pool.conf
listen = 127.0.0.1:11000

# In Apache vhost
ProxyPassMatch ^.*[.]php$ fcgi://127.0.0.1:11000/home/mypool/public

And this does not:

# In pool.conf
listen = /run/php/php8.2-fpm-mypool.sock

# In Apache vhost
ProxyPassMatch ^.*[.]php$ unix:/run/php/php8.2-fpm-mypool.sock|fcgi://localhost/home/mypool/public

I am getting AH01079: failed to make connection to backend.

What I did until now:

  • Checked that PHP fpm is running and parsing my config correctly (via ps and netstat)
  • Checked socket exists and has correct permissions (yes and it looks like it is created with the intended user and group)
  • Put apparmor in complain mode

I am running out of ideas.

kab00m avatar
br flag
Check audit.log for SELinux messages if you have it. And you also missed the port in fcgi part of second example. I also think you should have ProxyPassMatch arguments quoted.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.