Welcome! Log In Create A New Profile

Advanced

Apache DirectoryIndex fails to serve file to php-fpm, proxy_fcgi_module

Posted by j.l. hill 
Is it possible to configure php-fpm to serve a default DirectoryIndex file
as apache normally does?

When a directory request is received by apache and fcgi is included, apache
sends only the directory name to fcgi, not the file name, even though the
DirectoryIndex directive is set (DirectoryIndex works correctly without
fcgi).

I am guessing the problem is that DirectoryIndex is bypassed when a proxy
is included. From what I have read, this seems to be a problem for nginx as
well as apache, and I have found no solution using the proxy_fcgi_module
(using apache 2.4)

For several days I have tried ProxyPass, ProxyPassMatch, and ReWrite rules
in various httpd.conf sections (Location, Directory, VirtualHost) with
similar results (using php-5.4.7).

I can always get apache to serve files to it, but not the specified
DirectoryIndex file. For the root directory, it sends an empty string:

proxy_fcgi:trace1] [pid 1620:tid 139973627950848] util_script.c(599):
[client 186.108.136.84:44199] Status line from script '': 404 Not Found

Testing with minimal httpd.conf:

ServerRoot "/usr/local/apache"
Listen 80
User nobody
Group staff
ServerName myserver.com:80
LoadModule unixd_module modules/mod_unixd.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule dir_module modules/mod_dir.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule log_config_module modules/mod_log_config.so
DocumentRoot /usr/local/apache/www/
DirectoryIndex index.php
<Location / >
ProxyPass
fcgi://socket=%2fusr%2flocal%2fphp-fpm%2fvar%2frun%2ffpm-php.sock/usr/local/apache/www/
</Location>
ErrorLog "|/usr/bin/cronolog /usr/local/apache/logs/lexpert-error.%U-%Y.log"
CustomLog "|/usr/bin/cronolog /usr/local/apache/logs/lexpert.%U-%Y.log"
combined
LogLevel trace2

I have tried with the standard
fcgi://127.0.0.1:9000/usr/local/apache/www/$1 as well. I started off using
the basic instructions at http://wiki.apache.org/httpd/PHP-FPM. (Currently
testing with php-5.4.7)

Every test has had the same problem with DirectoryIndex.

Any suggestions appreciated.

Thanks in advance,

J.L. Hill
[Running on Debian Squeeze]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 266
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready