Bug #55322 [Com]: Apache : TRANSLATED_PATH doesn't consider chroot
| From: | me at paw-e-l dot net | Date: | Tue, 03 Apr 2012 07:12:21 +0000 |
| Subject: | Bug #55322 [Com]: Apache : TRANSLATED_PATH doesn't consider chroot | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169182@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55322&edit=1
ID: 55322
Comment by: me at paw-e-l dot net
Reported by: gregoire dot leroy at retenodus dot net
Summary: Apache : TRANSLATED_PATH doesn't consider chroot
Status: Assigned
Type: Bug
Package: FPM related
Operating System: Debian
PHP Version: 5.3.6
Assigned To: fat
Block user comment: N
Private report: N
New Comment:
The problem with chroot is that its path is added to apache document root. Workaround is quite
nasty. Let me explain using example.
Your site is in /var/www/yoursite/public_html (this is DocumentRoot in apache virtual host with
yoursite.com domain).
In fpm pool config chroot = /var/www/yoursite
Now when you request http://yoursite.com/index.php fpm
looks for that file under /var/www/yoursite/var/www/yoursite/public_html/index.php so the path to
file is concatinated chroot path and DocumentRoot.
To make it work create following catalogs structure /var/www/yoursite/var/www/yoursite/public_html
and one symlink /var/www/yoursite/public_html pointing to
/var/www/yoursite/var/www/yoursite/public_html
Previous Comments:
------------------------------------------------------------------------
[2011-08-02 01:30:30] gregoire dot leroy at retenodus dot net
Hem... On pastebin links, you can ignore AliasMatch directive. I tried this directive as solution
but even without AliasMatch it didn't work.
------------------------------------------------------------------------
[2011-07-30 00:37:21] gregoire dot leroy at retenodus dot net
Description:
------------
I use Apache and mod_fastcgi and I use PHP-FPM via a socket. I try to use the chroot directive.
When I don't use the chroot directive, the setup works fine. But when I use the chroot
directive, I've an Apache error : File does not exist: /index.php
My vhost config : http://pastebin.com/fmCJQUsS
My pool config : http://pastebin.com/9NqEjEft
I think it's due to the fact that TRANSLATED_PATH doesn't consider the chroot.
We could add a directive "chroot_translated_path", which, when activated, would truncate
the PATH_TRANSLATED.
Actual result:
--------------
Apache log :
[error] File does not exist: /index.php
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55322&edit=1