OpenVZ sharing PHP5-FPM socket

init0 asked:

I need a problem with sharing php5-fpm.sock between 2 vz containers
I have 2 containers:
1. with NGINX

2. with PHP5 and PHP5-FPM

Link containers over NFS

I tried using:
1. mount –bind /var/lib/vz/private/100/var/src_dir_with_socket /var/lib/vz/private/101/var/dst_dir_with_socket
2. moutn -t simfs …
3. pure NFS
for sharing php5-fpm.sock on NGINX container – does not work

Scheme to work only when I mount FPM at port
I need to work through SOCKET


My answer:

Generally, you can’t share a UNIX domain socket between two different virtual machines.

In the particular case of OpenVZ, you can’t share a UNIX domain socket between VEs without special kernel patches to break the security. From searching the Internet I see that such patches were written several years ago, but there’s no indication of whether they have been kept up to date.

If you really want to do this, you should seek help in an OpenVZ support channel. This is not a recommended configuration.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.