I upgraded to Apache 2.4.4 which now uses php-fpm (http://php-fpm.org/) instead of mod_php. Unfortunately, I'm having a lot of trouble getting it to proxy all the requests. The best setup I have so far let's me view the login page, with working CSS and graphics. However, upon clicking login, nothing happens and I get a 'File not found', so I'm sure I'm not handling mod_proxy correctly.
This has been very frustrating and I appreciate any insight.
# /etc/httpd/conf.d/ssl.conf
<VirtualHost *:443>
ServerName mail.domain.org
DocumentRoot /var/www/roundcubemail
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/domain.crt
SSLCertificateKeyFile /etc/pki/tls/private/domain.key
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/roundcubemail/$1
ProxyPassMatch ^/index$ fcgi://127.0.0.1:9000/var/www/roundcubemail/index.php$1
DirectoryIndex index.php
</VirtualHost>
This gets me a login page, visible at mail.domain.org/index. But clicking login redirects me to mail.domain.org and a file not found.
# /var/log/httpd/error_log
[Tue Sep 10 10:42:20.330694 2013] [proxy_fcgi:error] [pid 20661:tid 139766112696064] [client 129.105.*.*:51544] AH01071: Got error 'Primary script unknown\n', referer: https://mail.domain.org/index
The goal would be to have everything show up at mail.domain.org.
I should also point out that the official httpd guide (https://wiki.apache.org/httpd/PHP-FPM) doesn't work, and results in a 'File not found.' page.
I haven't played with Apache 2.4.x so I'm not sure how much help I can be, but I'd guess its the following line:
ProxyPassMatch ^/index$ fcgi://127.0.0.1:9000/var/www/roundcubemail/index.php$1
Try:
ProxyPassMatch ^/index.php$ fcgi://127.0.0.1:9000/var/www/roundcubemail/index.php$1
Thanks for the feedback! Interestingly, that leads to a 'File not found.' being displaying on both mail.domain.org and mail.domain.org/index.php.
The httpd error_log shows:
[Tue Sep 10 13:55:42.182882 2013] [proxy_fcgi:error] [pid 22024:tid 139909161531136] [client 129.105.*.*:55041] AH01071: Got error 'Primary script unknown\n'
The error seems to be a common one, although I can only find fixes using nginx, rather than Apache (example (https://wiki.archlinux.org/index.php/Nginx#Error:_.22File_not_found.22_in_browser_or_.22Primary_script_unknown.22_in_log_file)).
Woot! I have a working configuration now. Not sure how I didn't try this previously...
<VirtualHost *:443>
DocumentRoot /var/www/roundcubemail
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/roundcubemail/$1
ProxyPassMatch ^/$ fcgi://127.0.0.1:9000/var/www/roundcubemail/index.php$1
DirectoryIndex index.php
</VirtualHost>