[SOLVED] how to access unix socket from within chroot jail
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a server running nginx from within a chroot jail. Nginx is able to connect to fastCGI with the following lines:
listen = 127.0.0.1:9000
I want to use a unix socket for the connection with the following lines:
listen = /run/php-fpm/php-fpm.sock
Of course nginx can't find the socket from within the jail. My question is: what would be the best way to bring the socket into the jail or link to it somehow? I brought some devices into the jail with the following code:
# export JAIL=/srv/http
# mkdir $JAIL/dev
# mknod -m 0666 $JAIL/dev/null c 1 3
# mknod -m 0666 $JAIL/dev/random c 1 8
# mknod -m 0444 $JAIL/dev/urandom c 1 9
would something similar work with the unix socket?
Thank you linosaurusroot and jpollard. I got it to work by simply reconfiguring php-fpm to create the socket inside the jail. I had to override a path prefix in the php-fpm.conf file. I had to do the same with mysql. My only question now is whether this is the most secure solution. If you have any insights I would be interested. If not, Thank you for your time and help so far.