Apache 2.4 with PHP-FPM

Posted by tubaguy50035 on Server Fault See other posts from Server Fault or by tubaguy50035
Published on 2012-09-20T14:57:58Z Indexed on 2012/09/20 15:39 UTC
Read the original article Hit count: 248

Filed under:
|
|
|

I'm trying to setup Apache 2.4 with PHP-FPM 5.4 using the new modules with Apache 2.4. The following is what I have currently in my virtual host file:

<VirtualHost *:80>
    ServerAdmin root@localhost
    DocumentRoot /var/www
    #Directory permissions
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Require all granted
    </Directory>
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I have PHP-FPM running using Unix sockets with a sock file located at /var/run/php5-fpm.sock. How do I proxy my requests to this sock file? I've seen some sites say to use ProxyPassMatch and others are saying Rewrite Rule. Are there pros or cons on either side?

Also, most sites I'm seeing are showing ProxyPassMatch with a regex to only pass .php files. Could I also send it .html files? For whatever reason, we have a ton of PHP inside .html files.

Edit: As noted in the comments, it looks like mod_proxy_fcgi doesn't support Unix sockets. Is there another module I should be using?

© Server Fault or respective owner

Related posts about apache2

Related posts about php5