Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
Apache2 mod_proxy_fcgi ProxyFCGISetEnvIf Directory Specific Override

Does anyone know if you can override a ProxyFCGISetEnvIf directive in a directory section? The documentation for apache's mod_proxy_fcgi says it is valid in a section, but I'm not seeing the ProxyFCGISetEnvIf apply when in the directory.

Here's an example:

<VirtualHost *:443>
    ServerName  test7.com
    ServerAlias  

    DocumentRoot /var/www/test

    ProxyPassMatch ^(.*\.php)$ fcgi://127.0.0.1:9001/var/www/test/$1
    ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/www/test:/usr/share/php:/usr/share/pear \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"

    <Directory "/var/www/test/cooldir">
         ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/www/test:/var/www:/usr/share/php:/usr/share/pear \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/test7.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/test7.com/privkey.pem

</VirtualHost>

When I'm in the "cooldir" directory, phpinfo() is showing the that the open_basedir variable value did not change. So, what's the hierarchy for ProxyFCGISetEnvIf values in mod_proxy_fcgi? I would imagine it should work like nginx with specific directory declarations overriding the top level. For example, in nginx, this works:

location /cooldir {
    root /var/www/test/;
    index index.php index.html index.htm;

    location ~ ^/cooldir/(.+\.php)$ {
        try_files $uri =404;
        root /var/www/test/;
        fastcgi_pass 127.0.0.1:9001;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param  PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
        include /etc/nginx/fastcgi_params;
        limit_req zone=one burst=5;
    }
}

Any help is appreciated.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You have to use a <Location> directive instead of a <Directory> directive according to a response I received on the apache users mailing list:

<Location "/webmail">
        ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda