Created
May 4, 2016 15:34
-
-
Save mdpuma/e246f7cbc37fa628def9e618525006f9 to your computer and use it in GitHub Desktop.
Apache memory leak mod_rewrite recursion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ISSUE: | |
| # Example of bad rewrite rule | |
| # first, check if url is not file or directory, if not then do rewrite! | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule "^(\S*)\s+(\S*\s.*)$" $1-$2 [N] | |
| # if is set N flag, do this rewrite indefinitely (limited to 32000 iterations in apache >= 2.4.8) | |
| ################################ | |
| # FIX: | |
| # decrease limit 32000 if is needed | |
| # file modules/mappers/mod_rewrite.c | |
| # 239 line: | |
| #ifndef REWRITE_MAX_ROUNDS | |
| #define REWRITE_MAX_ROUNDS 32000 | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment