Apache PHP-fpm chroot将错误的DocumentRoot传递给php

我遇到以下问题:如果chroot,Apache会将错误的DocumentRoot移交给我的PHP-fpm实例

我当前的解决方案是使用
ProxyPassMatch "^/(.*\.php)$" "unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/htdocs"
但是根据Apache ProxyPassMatch的执行,在执行任何其他语句之前,这使我无法尝试实现Kerberos,因为指向内核真实的<File>文件的简单*.php指令将被忽略。>

所以我开始寻找适当的解决方案(因为ProxyPassMatch指令已经在半年前解决了。

我当前的“解决方案”是在chroot中添加一个模仿原始文件路径的符号链接,以使php重新工作。

ApacheConfig:

DocumentRoot /var/www/storage/site/htdocs/
<FilesMatch \.php$>
   SetHandler "proxy:unix:/run/php/php7.2-dev-fpm.sock|fcgi://localhost/"
</FilesMatch>

在文件系统上

/var/www/storage/site/var/www/storage/site $ ls -al htdocs
lrwxrwxrwx 1 root root 19 Jan 28 14:24 htdocs -> ../../../../htdocs/

这看起来很丑陋,我不得不承认,我不确定这是否意味着任何安全风险? (路径遍历的东西???)
但是至少可以用!

那么告诉Apache更改其移交给php-fpm的路径的正确方法是什么?

This link没有提供合适的帮助

sin777sin 回答:Apache PHP-fpm chroot将错误的DocumentRoot传递给php

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2698288.html

大家都在问