Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Apache php-fpm proxy configuration #4708

Closed
wants to merge 3 commits into from
Closed

Conversation

TeLiXj
Copy link
Contributor

@TeLiXj TeLiXj commented Dec 29, 2014

Q A
Doc fix? Yes
New docs? No
Applies to All
Fixed tickets

I had problems using ProxyPassMatch and mod_rewrite and now I use SetHandler to send the request to proxy. This change works fine and should be the standar configuration in the future for Apache and php-fpm.
You can read the php developers discussion here http://www.serverphorums.com/read.php?7,956732 or some about problems fixed here http://blog.famillecollet.com/post/2014/03/28/PHP-FPM-and-HTTPD-2.4-improvement

I had problems using ProxyPassMatch and mod_rewrite and now I use SetHandler to send the request to proxy. This change works fine and should be the standar configuration in the future for Apache and php-fpm.
You can read the php developers discussion here http://www.serverphorums.com/read.php?7,956732 or some about problems fixed here http://blog.famillecollet.com/post/2014/03/28/PHP-FPM-and-HTTPD-2.4-improvement
@TeLiXj TeLiXj changed the title Update web_server_configuration.rst Change Apache php-fpm proxy configuration Dec 29, 2014
@@ -132,8 +132,14 @@ directive to pass requests for PHP files to PHP FPM:
#
# SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1

# For Apache 2.4.9 or upper
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] or higher

@TeLiXj
Copy link
Contributor Author

TeLiXj commented Dec 29, 2014

Updated! Thanks xabbuh

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1

# For Apache 2.4.9 or higher
# Using SetHandler avoids issues with using ProxyPassMatch in combination with mod_rewrite or mod_autoindex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also please wrap this line after the first word that crosses the 72nd character?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@xabbuh
Copy link
Member

xabbuh commented Dec 29, 2014

@TeLiXj Thanks for providing the patch and for your fast reaction. 👍

@TeLiXj
Copy link
Contributor Author

TeLiXj commented Dec 29, 2014

@xabbuh thanks for ur work here!!! :)

@TeLiXj TeLiXj closed this Dec 29, 2014
@TeLiXj TeLiXj reopened this Dec 29, 2014
@weaverryan
Copy link
Member

Wow, very well-researched @TeLiXj! Thanks very much for this!

weaverryan added a commit that referenced this pull request Jan 3, 2015
This PR was submitted for the 2.6 branch but it was merged into the 2.3 branch instead (closes #4708).

Discussion
----------

Change Apache php-fpm proxy configuration

| Q             | A
| ------------- | ---
| Doc fix?      | Yes
| New docs?     | No
| Applies to    | All
| Fixed tickets |

I had problems using ProxyPassMatch and mod_rewrite and now I use SetHandler to send the request to proxy. This change works fine and should be the standar configuration in the future for Apache and php-fpm.
You can read the php developers discussion here http://www.serverphorums.com/read.php?7,956732 or some about problems fixed here http://blog.famillecollet.com/post/2014/03/28/PHP-FPM-and-HTTPD-2.4-improvement

Commits
-------

1873305 Update web_server_configuration.rst
41ac8c7 Update web_server_configuration.rst
71a24aa Update web_server_configuration.rst
@weaverryan weaverryan closed this Jan 3, 2015
@xabbuh
Copy link
Member

xabbuh commented Jan 4, 2015

@TeLiXj I just noticed that the introduction now doesn't cover the configuration anymore. I started to reword it, but now I'm wondering if one still needs mod_proxy and mod_proxy_fcgi to be able to use the SetHandler directive in the right way. Can you help me with this?

@TeLiXj
Copy link
Contributor Author

TeLiXj commented Jan 4, 2015

Of course, you always need mod_proxy and mod_proxy_fcgi to enable fpm-php on Apache.
The use of SetHandler only simplifies the way to redirect requests to a FastCGI proxy

@xabbuh
Copy link
Member

xabbuh commented Jan 4, 2015

@TeLiXj Thank you, this helps me very much. And by the way, happy new year to you!

weaverryan added a commit that referenced this pull request Jan 4, 2015
…not ProxyPassMatch) (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[Cookbook][Configuration] update text to use SetHandler (not ProxyPassMatch)

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

This reflects the changes to the default configuration introduced with #4708 in the introduction.

Commits
-------

9d84d03 update text to use SetHandler (not ProxyPassMatch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants