Running php-fpm with httpd 2.4.4 in CentOS 6.4

frenchja asked:

I upgraded to httpd 2.4.4 from the httpd 2.2 that shipped with CentOS/RHEL 6.4. I’m running into an error trying to serve Roundcube mail using php-fpm. We tried a number of solutions on #httpd at Freenode. I would greatly appreciate any insight. It worked well with httpd 2.2.

These instructions were followed so far:

The error I get is Forbidden: You don't have permission to access / on this server. The error log says:

[Fri Sep 06 15:26:23.542241 2013] [autoindex:error] [pid 16868:tid 140266652563200] [client] AH01276: Cannot serve directory /var/www/roundcubemail/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive

VirtualHost in /etc/httpd/conf.d/ssl.conf

<VirtualHost *:443>
    DocumentRoot /var/www/roundcubemail
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/domain.crt
    SSLCertificateKeyFile /etc/pki/tls/private/domain.key
    ProxyPassMatch ^/(.*.php(/.*)?)$ fcgi://$1


<Directory "/var/www/roundcubemail/">
    Options -Indexes
    SetOutputFilter DEFLATE
    AllowOverride All
    Require all granted


AddDefaultCharset     UTF-8
AddType text/x-component .htc

<IfModule mod_php5.c>
php_flag        display_errors  Off
php_flag        log_errors      On
# php_value     error_log       logs/errors

php_value       upload_max_filesize     5M
php_value       post_max_size           6M
php_value       memory_limit            64M

php_flag        zlib.output_compression         Off
php_flag        magic_quotes_gpc                Off
php_flag        magic_quotes_runtime            Off
php_flag        zend.ze1_compatibility_mode     Off
php_flag        suhosin.session.encrypt         Off

#php_value      session.cookie_path             /
php_flag        session.auto_start      Off
php_value       session.gc_maxlifetime  21600
php_value       session.gc_divisor      500
php_value       session.gc_probability  1

php_value       mbstring.func_overload  0

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^favicon.ico$ skins/larry/images/favicon.ico
# security rules
RewriteRule .git - [F]
RewriteRule ^/?(SQL|bin) - [F]

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE

<IfModule mod_headers.c>
# replace 'append' with 'merge' for Apache version 2.2.9 and later
#Header append Cache-Control public env=!NO_CACHE

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"

FileETag MTime Size

<IfModule mod_autoindex.c>
Options -Indexes

My answer:

It’s PHP, isn’t it? Your VirtualHost should also contain:

DirectoryIndex index.php

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.