Hello!
I've tested this across multiple Drupal 7.22-7.23 installs. Sites were working A-ok with Boost before an upgrade to Apache 2.4.x (mod access compat is on). Now, the homepage (a view at /frontpage) won't utilize the cached file (no Boost Header, no
comment, slow performance). The cached boost file is created in the proper cache/*/*/_.html location. The _.html file is recreated every page load. The file is accessible if navigating to it directly; it displays as expected. All other pages (views pages, nodes, etc) cache and are served properly without issue.
I've spent hours diagnosing this and it seems to be related to the .htaccess file, specifically the %{REQUEST_URI}.
If I manually adjust the # NORMAL boost line:
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
to
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}/_%{QUERY_STRING}\.html [L,T=text/html]
Which is to say, replacing %{REQUEST_URI} with a slash (/) which is what you'd expect the homepage to be. The cached homepage is served (but of course no subpages work as we're forcing the rewrite).
If I change the RewriteRule flags from [L,T=text/html] to a redirect [R=301] - the page is properly redirected to the right URL.
It seems like some combo of the Rewrite, the %REQUEST_URI, the upgrade to Apache 2.4, and solely the homepage (root of the domain e.g. www.domain.com). Other folder roots (e.g. www.domain.com/articles) works fine, served via Boost. Thoughts? I've tested this on a vanilla 7.23 install with the latest Boost and encountered the same issues.
EDIT: There seems to be a number of similar issues (which I've reviewed with no luck):
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThere's another thread similar to this, one thing that was noted was that mod_mime seems to perform differently with mod_rewrite specifically in that mod_rewrite's flags L=text/html should correspond to addType but something goes awry. But what we really need at this point is proper debugging from the apache log and 2.4 has now deprecated the RewriteLog and one should now use the built in logging functions (see section on this page http://httpd.apache.org/docs/current/mod/mod_rewrite.html )
I suspect that the end slash is being added by an internal rewrite and then skipping the rules but we really need help to confirm this. The other thread leads to a blank page being presented which is normally symptomatic of a header and no content being sent and then cached (so boost would store nothing for the index page if it were redirected to a folder) if the issue can be narrowed down then we can put an if clause in the rules if necessary or bump it up to drupal core if the redirects for www.* are responsible.
Comment #2
chrisrcooper CreditAttribution: chrisrcooper commentedI believe I saw something similar on that, probably the same thread. I don't know if it helps, but here's a slightly obfuscated snap from the rewrite logs:
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedYes that does help and seems to confirm that the rules are being missed because of an internal redirect (at least that's my interpretation of it) do you have lynx ? The problem with modern browsers is that sometimes they append the / and I'd really like to see if there is a difference between http://www.example.com , http://www.example.com/ and http://www.example.com/index.php through the logs and whether boost is picked up at any point, or indeed the difference on one of your example pages that you mentioned does work.
Comment #4
chrisrcooper CreditAttribution: chrisrcooper commentedI've been testing via latest FFX and Safari, I don't have Lynx handy. For the particular domain I highlighted, Global Redirect is setup with relevant options - so .com, .com/, and .com/index.php all end up at the same place - .com, and none of them get boosted. I'll note though that if I disable the /frontpage redirect, I can access /frontpage directly and that *does* get boosted.
On my test setup (nothing really installed but Boost & dependencies, so no Global Redirect) - there doesn't seem to be any difference - same problem.
Comment #5
chrisrcooper CreditAttribution: chrisrcooper commentedDisabling redirect for index.php and going manually to it creates index.php_.html cache which *does* get served by Boost.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedWhich redirect, the drupal core redirect ?
Comment #7
chrisrcooper CreditAttribution: chrisrcooper commentedEven more interesting, the creation of that index.php_.html means that now the root www.domain.com is getting boosted (and I double-checked it's the index.php_.html). For a short-term solution I might just symlink to index so this particular site stops hammering servers.
Regarding disabling the redirect, I was referring to fully disabling the Global Redirect module (which handles the index.php redirect). Without it, /index.php and / are accessible.
EDIT: Of course creating a symlink from _.html -> index.php_.html will only work until caches are flushed.
Comment #8
jerry CreditAttribution: jerry commentedI've encountered the same problem - front page cached but served as blank - with the current versions of Boost for both D6 and D7 running on Apache 2.4.6 with PHP via FastCGI. I've worked around it for now by inserting special handling for the front page in the Boost .htaccess rules, but I'd love to see a supported solution that I could roll out to my many shared-hosting clients. As their hosts may upgrade Apache at any time, this is a pretty ugly problem: their front pages could disappear without warning.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedWhen it serves a blank page, is there any html content at all ?
Any relevant headers because we have to negate that there is an issue like content being zipped and sent with the wrong filesize (has happened before with chrome).
Are there any log indications to state that the cached page has been served, previously the logs seem to indicate that something in 2.4 is ignoring the boost rules for / and reverting to the drupal set and going to index.php
can _.html be accessed directly by typing the URL into the browser and going through cache/normal ?
I may be able to spin up some virtual images this weekend to investigate this further, is there a particular distribution that this is affecting.
Comment #10
chrisrcooper CreditAttribution: chrisrcooper commentedWe ended up fully implementing Varnish as Boost couldn't fulfill our needs on our infrastructure so my memory is getting a little foggy now, but just to reiterate: the meat of the issue was that the $REQUEST_URI provided by Apache via .htaccess and highly relevant for Boost would serve the landing page as a $REQUEST_URI including "index" so our frontpage's cache file needed to be index_.html (or something similar, I do not recall) for things to work with Boost.
In other words, Boost would create _.html properly as the cached frontpage but when the frontpage was accessed, Boost would look for index_.html (again, might have been index.php_.html or something else) due to the $REQUEST_URI.
We didn't have anything odd going on with the landing page or some special configuration for indexes that I know of; and this wasn't an issue with the previous 2.2.x version of Apache we were running.
Hope it helps!
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAny idea what distribution and if it was mod_php or php/fast cgi?
Comment #12
chrisrcooper CreditAttribution: chrisrcooper commentedPHP-FPM (FastCGI). Linux Distro was both Ubuntu 12.04 LTS and 12.10 (happened to be doing an upgrade same time). Drupal distro was latest core. Boost module was both latest recommended and latest dev.
Comment #13
jerry CreditAttribution: jerry commentedThanks for the quick response, Philip. A bit more information: I've now moved two D6 and two D7 sites to the same environment (Apache 2.4.6, PHP 5.3.27 via FastCGI, Ubuntu host). One D6 and one D7 site presented a blank front page to anonymous users, and the other two sites simply served a non-cached page. I haven't yet identified the cause of the differing behavior, as Boost was configured identically on the two D6 sites and the two D7 sites.
I thought I had a usable manual .htaccess workaround for the front page for both, but it's turned out to be unreliable on the D6 sites and I haven't yet determined why. It does seem to be reliable on D7. (It just checks REQUEST_URI for /index.php and serves the _.html page for it.)
In answer to your questions:
On both D6 and D7, what's served is the contents of index.php in plain text (without PHP interpretation).
The headers were the same on both systems and looked normal to me. Their lengths were correct for the data served. Example from D6:
No. So far as I can tell, the front page cache is created correctly, but it's not served by the Boost .htaccess rules because the value of REQUEST_URI isn't '/' (as before), but '/index.php'.
Yes, it can.
I don't know how much trouble this would be to manage DB-wise, but would it be possible to special-case the front page and cache two copies of it, one as _.html (as before) and one as index.php_.html? This might be a fairly simple way to accommodate both older and newer Apache behaviors.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedIs quite a concern and seems to indicate that the .htaccess rules from the cache folder are being applied to index.php in drupal root and that php/ fastCGI is not being called.
The REQUEST_URI being index.php is not incorrect per se as using clean url's is always going to end up there from the drupal core rules, what is more of a concern is that in 2.4 it appears to apply an additional rewrite to make it index.php rather than leave it as / which seems to be the starting point for the investigation, i.e. not using boost and recording the differences.
Thanks, oddly I do all of my testing on vanilla 12.04 LTS so this is surprising that it hasn't happened in any of my environments when testing other components for debugging.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedJust a note for Ubuntu 12.04 LTS. The default (and official) apache version is 2.2.22
https://launchpad.net/ubuntu/precise/+source/apache2
this does not mean that this issue is not being actively investigated, there are other instances of updates causing white screens too some of them appear to be related to not re-enabling the php-fcgi handler after installation.
Comment #16
jerry CreditAttribution: jerry commentedI'm indeed using 12.04.2 LTS; these are all Pair Networks accounts. I moved another two sites (one D6, one D7) to that environment this evening, and both exhibited the same problem. FWIW, no other white-screen issues or other problems have been observed with any of these installations.
Comment #17
Anonymous (not verified) CreditAttribution: Anonymous commentedSo apache 2.4 on ubuntu 12.04.2, any idea which PPA ? or was it built for you ?
Comment #18
jerry CreditAttribution: jerry commentedThese are standard shared hosting accounts in their server pool, so everything was pre-built.
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commenteddo you have any form of ssh access to run
apache2ctl -M
because I am not getting anywhere in getting 12.04 Ubuntu to install fcgi, some information is stating that the FastCGI module is deprecated for Apache 2.4 and mod_proxy_fcgi and php-fpm being a replacement.
Comment #20
jerry CreditAttribution: jerry commentedShell access, yes, but don't seem to have it in my path or be able to find it in the likely places. Where would Ubuntu normally put this? My admin experience has been on CentOS.
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commentedApache 2.4 is not compatible with boost 7.x or 6.x for serving the index page and possibly any subdirectories that rely on mod_dir
The issue is that mod_rewrite does not stop at a / e.g. www.example.com/ the boost rewrite rules are correct, the existence on _.html is found and an internal redirect takes place but then mod_dir checks if a slash needs to be added to the end to give a valid directory (even if one exists), then if it is a valid directory then it presents the directoryIndex instead of redirecting.
Above is reasonably clear evidence of this, where after hitting the boost redirect instead of stopping (the new END flag has no effect) mod_dir starts to cycle through possibilities like index.html until it finds index.php.
One can get drupal working by various means by altering
DirectoryIndex disabled
which does cache an index page but then fails on queries like www.example.com/?o=8 which has implications for other modules.
The good news. Apache-dev appears to be aware of this already
http://apache-http-server.18135.x6.nabble.com/PATCH-mod-rewrite-mod-dir-...
was posted in the last week, I do not hold out much hope for being able to create a rewrite rule that will be able to stop before mod_dir starts it's cycle because of the end slash.
Comment #22
Anonymous (not verified) CreditAttribution: Anonymous commentedShell access, yes, but don't seem to have it in my path or be able to find it in the likely places. Where would Ubuntu normally put this? My admin experience has been on CentOS.
I got a version of Apache 2.4 on Ubuntu 12.04 working and the news is not good, see above...
Comment #23
jerry CreditAttribution: jerry commentedThanks for your research on this.
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedAfter more investigation the trigger for the apache 2.4 loop is the use of %{REQUEST_URI} which means there will be no possible solution using any rewrite rules as we need this to create the file path for the cache.
Comment #25
jerry CreditAttribution: jerry commentedFWIW, the following .htaccess changes allow my D7 sites to cache the front page via Boost. D6 needs additional work, probably due to the difference in how it handles page routing.
This appears to be working OK for me, though there may be failure cases or side effects that I haven't observed yet.
Comment #26
Anonymous (not verified) CreditAttribution: Anonymous commentedDoes your set up generate _.html in the cache ? also what happens with
http://www.example.com/?x=y
just a querystring passed to the root ? As I've been working on a similar ruleset.
Comment #27
Anonymous (not verified) CreditAttribution: Anonymous commentedif drupal is not in / but in a subdirectory like /drupal
needs to be altered to
where the XXX_folder_XXX is replaced by the subdirectory including the first slash e.g. /drupal
RewriteBase does not appear to be functioning in the manner that I would expect. This workaround still goes through the loop and placing the special handling has no effect on the speed of the rule's interpretation (both rules have REQUEST_URI in them so mod_dir is still triggered.
Comment #28
jerry CreditAttribution: jerry commentedYes, it does. Boost will subsequently serve the file.
_x=y.html is written to the cache and subsequently served by Boost.
Comment #29
jerry CreditAttribution: jerry commentedThanks. I hadn't tested that case.
Comment #30
Anonymous (not verified) CreditAttribution: Anonymous commentedWe were working along exactly along the same lines just from slightly differing directions. I'll to roll a patch this week as fedora has already made the switch to 2.4 and they'll be a lot of collocated machines out there and as it's not a "security bug" it's probably not high on Apache's dev list.
Comment #31
jerry CreditAttribution: jerry commentedGreat, thanks.
Have you had any luck with a similar workaround for D6?
Comment #32
Anonymous (not verified) CreditAttribution: Anonymous commentedNot as yet, I hammered out similar to yours in the early hours UK time and have prepared an example for the apache dev list with logs. I need to have a discussion with the main boost maintainer about this and several outstanding patches and where I believe they should go and in which priority.
Comment #33
dendritic CreditAttribution: dendritic commentedThanks jerry, that fix is working for me.
Comment #33.0
dendritic CreditAttribution: dendritic commentedRelated links
Comment #34
jerry CreditAttribution: jerry commentedPhilip, have you had time to make any progress on a D6 workaround and/or a D7 patch for this problem yet?
Comment #35
rnyberg CreditAttribution: rnyberg commentedAfter debugging the same problem for 3 hours, I finally found this issue. Thank's a lot jerry, your fix works for me as well! :)
Comment #36
jerry CreditAttribution: jerry commentedOK, I've finally had both time and motivation to return to this issue, and I have a workaround for D6 as well. It's essentially the same as the one presented in #25 for D7 with the paths adjusted for D6, but with one obscure but necessary change: a slash has been added prior to the argument list in the standard redirect rule following the Boost section:
As before, the changes are tagged with a comment including "Apache 2.4". Philip's note in #27 about modifying the added rewrite rules for use in a subdirectory still applies.
Comment #37
jerry CreditAttribution: jerry commentedWhile I don't have the resources to check the .htaccess workarounds provided above against non-Apache servers, I've verified that both the D6 and D7 versions function normally on Apache versions 1.3.41 and 2.2.25 in addition to the problematic 2.4.6. Perhaps they could be provided in a Boost update and optionally disabled via a checkbox for non-Apache systems.
Comment #38
jerry CreditAttribution: jerry commentedWhile no module patch has been provided, I'm going to set the issue status to "Needs review" for now in the hope of attracting additional testers for the proposed workaround.
Comment #39
scalp CreditAttribution: scalp commentedCame across this issue and found a solution in #25. This was the only way I was able to get my front page to serve its cached version. All other pages were serving correctly and I could see that the front page was being cached, but until using jerry's code I could not get the front page to be served. I had tried every combination of Server's URL/Document Root in the UI with no success. Based on #33, #35, and my testing I'm going to mark this as RTBC. Hope that's not premature. Thanks jerry!
Comment #40
SkinI confirm : solution #25. works ; I hope for an official patch
P.S. thanks Jerry
Comment #41
SkinProbably I found another bug related to boost and apache 2.4 : after applying of patch #25, l If I make a search from the cached homepage as anonymous user ( I mean from a search block in the home ) and if the searched term is not in the database I don't see anything: there is no redirect to /search/node page with the message "Your search yielded no results ecc. ".. nothing happens and I remain in the home page.
If I make the same exact thing from a different page ( a cached page as anonymous user ) everything works, I'm redirected to search/node; the problem on the home page is not present if i try to search after doing login.
Comment #42
Anonymous (not verified) CreditAttribution: Anonymous commentedCan you confirm that #2078595-27: Apache 2.4 Won't Serve Frontpage Cache File (_.html) after 2.2 Upgrade does not apply ? that your drupal installation is not in a subfolder? As the code for subfolders would be in the next release rather than the code solution that is frequently quoted.
Comment #43
SkinI've tried on two or three sites, no one of them is in a subfolder.
Comment #44
jerry CreditAttribution: jerry commentedI can confirm this behavior, at least on D7. The cache files for searches from the search block on the home page are not generated, and the site appears to redirect to the home page immediately. I don't have an appropriate site for testing this on D6 immediately available.
Comment #45
Anonymous (not verified) CreditAttribution: Anonymous commentedCan we confirm that it is the same bug, that when right clicked in the browser and "view source" or the equivalent, one gets the index.php from Drupal core which appears blank because it starts with < ?
In your Drupal 7 set up is a cached file generated at all ?
Comment #46
jerry CreditAttribution: jerry commentedI can now confirm that D6 exhibits the same behavior.
Comment #47
SkinCorrection:
the search won't work even if the entry is in the database, instead of the list of the found terms i continue to see the homepage
Comment #48
SkinI'm going to downgrade my VPS from Apache 2.4.x to Apache 2.2.x.
If someone is going to release a patch I'll test it on a local virtual machine, so I hope I can be helpful in some way.
Anyway thanks for your help :-)
Comment #49
Joel MMCC CreditAttribution: Joel MMCC commentedAm I correct in assuming that if caching for .xml and .json is also enabled, that additional rules need to be added to #25 as they appear in the .htaccess Generation page for the #GZIP and #NORMAL sections? And does “[S=5]” need to be set to “S=7” and “[S=2]” need to be set to “[S=4]” accordingly? And if only one of the two were activated, S should be set equal to 6 and 3, respectively?
Comment #50
jerry CreditAttribution: jerry commentedJust observe the comments:
You need only add the indicated deltas to whatever skip values were auto-generated by Boost. Those values already reflect the XML/JSON choices. If you change your caching choices in Boost, it may be simplest to start over and re-apply the edits in this issue to the resulting set of rules.
Comment #51
Joel MMCC CreditAttribution: Joel MMCC commentedOkay, for awhile I couldn’t get the caching to work at all until I implemented the change I described in my #49. However, doing so with the .xml and .json caching activated had a strange side-effect: Boost was now caching for logged-in users as well, including Admins, and redirecting all Admin URLs to the home page, completely locking out all Admin and other logged-in users from their special functions! (But hey, at least it did so very quickly!)
So, I commented out the lines involving the XML and JSON caching and set the two [S=#]s back to 2 less than I’d had them, namely to what is shown in @Philip_Clarke’s #25, then disabled those functions in the Boost configuration. Now everything is working properly.
I may try to re-enable XML caching alone, and JSON alone, and see which is causing this problem (I strongly suspect JSON). It may need another Issue (if so, I’ll create one and link this one to it as Related and/or Parent Issue), but since it can be invoked by people trying to implement the fix given here, I think it important to mention in it in this thread as well. I would like to cache at least XML for feeds.
Comment #52
Joel MMCC CreditAttribution: Joel MMCC commentedAh, figured out my #51. Thanks to @jerry’s #50, I figured out what “[S=#]” means: Skip Rules. So, setting those correctly solved that problem, and I have my XML and JSON caching enabled! Thanks! No new Issue will be forthcoming.
Comment #53
gnuget#25 and #36 also works for me but while there is not a patch this issue can't have a different status that "needs work"
Comment #54
gnugetAlso... i'm not sure if i'm the only one but, this patch makes fail the Search block in the homepage
Comment #55
SkinYou are not the only one, the search block in home page won't work.
Comment #56
Anonymous (not verified) CreditAttribution: Anonymous commentedDisable search.php in Boost' settings, there will be a movement of beta to stable code (this week), then the beta will be patched for the home page and I will look into rewrite rules for the search (as well as apply a lot of outstanding patches for other things).
Comment #57
SkinVery good news :-) , thanks.
Comment #58
jerry CreditAttribution: jerry commentedPhilip, can you be more specific about this? I have a number of D6 and D7 sites that will have their Apache version upgraded from 2.2.x to 2.4.x this week, ready or not, and some of them have the search form enabled on the front page. I'd love a workaround for that short of disabling caching for the entire front page, if it exists.
Comment #59
Anonymous (not verified) CreditAttribution: Anonymous commentedUnder 7.x what happens if in boost settings, Boost cacheability settings you click
All pages except those listed
set
search/*
click save and use ftp to remove any search files under cache/normal/www.example.com/search?
It should disable search page creation. (currently works in beta on nginx should work on apache if the files are removed otherwise it would hit .htaccess before the boost settings and one would have to wait for the cached pages to expire).
Comment #60
jerry CreditAttribution: jerry commentedOn my D7 test site, this didn't affect the problem that occurs when the front page search block is used. The symptom is as described above: upon submission of the search block form, the front page simply refreshes, the URL doesn't change, and of course no results are displayed.
If I visit /search instead of using the block, all appears to work normally without disabling search caching.
Comment #61
Anonymous (not verified) CreditAttribution: Anonymous commentedDo you know where you are going ? (not a religious or holistic question). The form must point somewhere either to search/user or search/node but from the front page there may be an additional redirect. Look in your cache and note the locations of any _.html files under search, it may be helpful to me.
Comment #62
jerry CreditAttribution: jerry commentedI fear that I am going nowhere, fast.
The form POST action is just "/", and no search code is being invoked at all when executed from the front page. After clearing the Boost cache, logging out and attempting to perform a search from the front page block, the cache contains only .htaccess and _.html. No search folder is created. It's as though the check for GET|HEAD is being ignored, though I don't how that could happen.
FWIW, the original problem was reported with Apache 2.4.6; I'm now seeing it with 2.4.9 as well.
Comment #63
Anonymous (not verified) CreditAttribution: Anonymous commentedthe original issue presented a white page, but when the source is viewed it turns out to be index.php just sent as html not having gone through the PHP process (probably because of the text/html header being set in boost's cache but then the rewrite rules carrying on working on index.php), if you view source is it the same or just nothing ? (just booting up the virtual machines for old and new OS's to get these patches sorted).
Comment #64
jerry CreditAttribution: jerry commentedSubmitting the search block form from the front page with the redirect patches previously posted applied results in a re-load of the front page from the Boost cache, which can be verified by the presence of the Boost footer comment. I haven't tested the behavior without the patches applied.
Comment #65
Anonymous (not verified) CreditAttribution: Anonymous commentedThat's logical enough if the form is sent to index.php except that it should be a POST and boost should then disable. I'll try and investigate it at the same time as working on the other patch but I have many platforms to test.
Comment #66
Anonymous (not verified) CreditAttribution: Anonymous commentedI have a testing problem, while the original issue was an apache issue that they knew about, and I was able to reproduce it on Ubuntu 12.04 with a manual update to apache 2.4.6, I cannot get the issue to appear on Ubuntu 14.04 with Apache 2.4.7 which appears to be fixed. Can anyone confirm the distribution that is causing the issue with Apache 2.4.9 or any default distribution ? as I was going to add a "i'm using apache 2.4 or 2.2" section to alter the .htaccess but it appears that al that work may have to go out of the window if apache have fixed it as it would break more installations than it would fix.
Comment #67
Anonymous (not verified) CreditAttribution: Anonymous commentedOkay there's a few tests I need completed.
The original issue and fix was for a front page not being served, also in 2.4.6 installations in sub-folders would not serve like www.example.com/drupal. What I am finding now is that Apache 2.4.7 serves everything correctly in a sub folder, and that with the original rules everything works except for the front page. So the tests I need done are to find the original rules and confirm that boost will serve everything except for the front page. This will require clearing out the current cache to check that files are being generated and not served, that searches are being served, otherwise the above "fix" is incorrect and needs to be altered. I'm stuck between a rock and a hard place because I now have conflicting distributions that work on everything (if in a sub folder) or the original issue means the sites all work except the front page, or the "fix" breaks the search and possibly other pages.
Comment #69
Anonymous (not verified) CreditAttribution: Anonymous commentedThere is a new development version to download (May 4th 2014 GMT or later) that may solve these Apache 2.4 issues. Download, install, generate the .htaccess file and then uncomment the two Apache 2.4 sections in .htaccess which should enable caching of the front page and searches from the front. Unfortunately the code is not compatible with Apache 2.2 and goes into a recursive rewrite loop. Eventually I Hope to have a select box to generate the code without comments but this needs testing first.
Comment #70
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #71
jerry CreditAttribution: jerry commentedFor what it's worth, I have representative D6/D7 systems running Boost 6.x-1.21/7.x-1.0-beta2 on Ubuntu 12.04.2 LTS. Using the original Apache 2.4.6 available at site installation, the front page problems described above were present. (I can't comment on subfolder issues.) The host skipped 2.4.7 and recently installed 2.4.9 on these servers. I've reverted to the .htaccess rules generated by Boost, discarding the workarounds posted above, and found that the front page and search block features again work normally on 2.4.9.
Comment #72
Anonymous (not verified) CreditAttribution: Anonymous commentedThe above mirrors my findings, that different distributions and versions do not act the same. The original bug was in mod_dir which adds a / at the end of the URI to check if it's looking for a folder, this leads to multiple internal redirections until with the white screen it appears to state "yes it's a folder" but takes the text/html rule and applies it to presenting the DirectoryIndex (index.php). It appears that mod_dir may have been modified or compiled differently with different distributions or versions.
Regardless, the fix is in place, if one is experiencing the issues above then uncommenting the lines of code in the dev version of boost in the .htaccess section appears to work across all versions of 2.4.x
Comment #73
Joel MMCC CreditAttribution: Joel MMCC commentedUsing the new -dev release seems to work fine until I try to log in. Immediately on entering user name and password credentials (whether correct or incorrect), it does “Internal Server Error 500.” Fortunately, I have a logged in session still active in another browser session from before I activated Boost, and it still works.
Commenting out all Boost lines in .htaccess restores the ability to log in again. Uncommenting them, with or without also uncommenting
RewriteBase /
above the### BOOST START ###
, causes it to fail again.Please help!
Comment #74
Anonymous (not verified) CreditAttribution: Anonymous commentedDoes your 2.4.x installation display the symptoms of the bug, white screen as normal (obviously not i you can see a log in screen), no caching of the front page, no search ability from the front page ? if so then you don't need the lines, the bug has been tracked as from mod_dir in apache and depends on version number and linux distribution.
Comment #75
Joel MMCC CreditAttribution: Joel MMCC commentedEverything else (that I’ve tried so far) appears to work fine. Front page gets cached and shows Boost comment at the bottom. Not tried Search yet.
For now, I could tell the client to let me know when they need to log in, and I can briefly comment out those lines long enough for them to log in, then uncomment them again. Once they’re in, it’s fine. It’s only the actual login process that errors out.
This could even have a side benefit of enhancing security, since basically no hacker could log in either except during the few seconds that I have Boost disabled. ;-) (Just trying to see the bright side here…)
Comment #76
Joel MMCC CreditAttribution: Joel MMCC commentedJust tried Search: it, too, 500s, so the workaround isn’t all that acceptable either.
Apache version 2.4.9
Comment #77
Anonymous (not verified) CreditAttribution: Anonymous commentedYes but what I mean is when the code is commented out does the site work? If so then keep it commented. It would help if I know which distribution and version of apache were installed.
Comment #78
Joel MMCC CreditAttribution: Joel MMCC commentedDebian 6.0.8 running Apache 2.4.9 and PHP 5.4.27. Site works fine (albeit slowly) when Boost commented out.
Comment #79
Joel MMCC CreditAttribution: Joel MMCC commentedOops! Not Debian. Used wrong SSH session to another server. The one in question doesn't appear to have a version or release file that I have even Read permissions on in
/etc/
(there is a “/etc/.etc.version
” but I have no permissions on it, not even read), so I have no idea how to tell what distro it is. It is Apache 2.4.9 and PHP 5.4.27, though.Comment #80
Anonymous (not verified) CreditAttribution: Anonymous commentedtried
lsb_release -a
leave it commented out, it does depend on which pap is used, for 12.04 ubuntu it wasn't working ad now i does, made creating the workarounds a right expletive.
Comment #81
drupalandme CreditAttribution: drupalandme commentedHi Friend,
I faced the same problem for this but now its working.Actually problem was that for front page it was not reading the _.html cached page and searched for the index.php_.html so made some changes in code and its working now if you say i will give you the solution.
Thanks
Pritika
Comment #82
Anonymous (not verified) CreditAttribution: Anonymous commentedwe already have a working solution for this in dev that requires the commenting out of a couple of lines in .htaccess. The issue depends on the version of apache installed and has been fixed for some distributions so is not a mainstream solution as a hosting update could remove the issue at any point.
Comment #83
chakrapani CreditAttribution: chakrapani commentedHi Philip,
As this is a major issue and for many users it would take a long time to figure out that there is a conflict with apache version and boost. It would be great if you can add a line mentioning the issue with Apache 2.4 and refer to this page for more details or to suggest dev version etc,.
Currently, it is mentioned that Apache is fully supported. Irrespective of being a regular user of boost I din't doubt something like this until after couple of days.
Even a minor note on the project page would be greatly helpful.
Regards
Chakrapani
Comment #84
roblogI have D6 running on a newly upgraded Ubuntu 14.04 with Apache 2.4. I've managed to get Boost working using the changes to .htaccess described in comment #25. I'm still having no luck with the front page search form however. I installed the latest dev version of Boost which doesn't improve the situation. Were can I find info on the two lines in .htaccess to comment out, as described in #82 ? My current .htaccess rules are pasted below. Do I still need to comment out these lines, with the settings that I have. Also, have others got the front page search form working on D6, or is it simply broken?
Thanks
### BOOST START ###
# See https://www.drupal.org/node/2078595 #25 for special settings for Apache 2.4
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTPS} on [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID
#RewriteRule .* - [S=1]
RewriteRule .* - [S=2] # Added 2 to this value to accommodate added rules for Apache 2.4
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
#Special handling for front page for Apache 2.4
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}/\_%{QUERY_STRING}\.html -s
RewriteRule .* cache/normal/%{SERVER_NAME}/\_%{QUERY_STRING}\.html [L,T=text/html]
#End Apache 2.4 rules
### BOOST END ###
Comment #85
Anonymous (not verified) CreditAttribution: Anonymous commentedThe dev version referred to was for Drupal 7. I'll try and remember what the work around for search.php was, because boost should be disabled if the search form is posted.
Comment #86
carsonwWhile the front page is being cached wonderfully with the .htaccess rules in #25, the search block form, when filled out and submitted, simply refreshes the front page, instead of redirecting to the search results page. This only happens on the front page of the website.
Comment #87
carsonwOops, spoke too soon... The dev version's .htaccess rules worked flawlessly on Apache 2.4.7.
Comment #88
Anonymous (not verified) CreditAttribution: Anonymous commentedPlease note that this is an apache rewrite bug which we built a work around for, in some distributions or if apache is updated to a different version, you may have to comment out the fix.
Comment #89
ymeiner CreditAttribution: ymeiner commentedhttps://bz.apache.org/bugzilla/show_bug.cgi?id=56434
this has been resolved on apache >= 2.4.9
We've just upgraded our servers to 2.4.12 and the bug is gone.
Comment #90
michaelkoehne CreditAttribution: michaelkoehne commentedApache 2.4.7
Boost 7.x-1.x-dev
Frontpage cache file (_.html) got refreshed every time when I access the front page.
my htaccess:
Comment #91
Christopher Riley CreditAttribution: Christopher Riley commentedIf I enable the first Apache 2.4 bug workaround and do not comment out the skip line I end up with a 500 error. Any ideas?
### BOOST START ###
# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]
# Apache 2.4 bug workaround
# Enables Search from home page https://drupal.org/node/2078595#comment-8724321
RewriteCond %{REQUEST_METHOD} ^(POST)$
RewriteCond %{REQUEST_URI} /
# RewriteRule .* / [S=3]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTPS} on [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [S=3]
# Apache 2.4 bug workaround
# Enables caching of index/ home page
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}/\_%{QUERY_STRING}\.html [L,T=text/html]
# NORMAL
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
RewriteCond %{DOCUMENT_ROOT}/cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.xml -s
RewriteRule .* cache/%{ENV:boostpath}/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.xml [L,T=application/xml]
### BOOST END ###
# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
Comment #92
Christopher Riley CreditAttribution: Christopher Riley commentedDoes anyone have any kind of feedback as to what might be going on? Following is what I get if I put apache into debug mode:
I just for grins and giggles changed the first rewrite rule to RewriteRule .* - [S=3] instead of RewriteRule .* / [S=3] and things seem to be working. Comments?
Comment #93
joelpittetre #91 I'm getting that 500 error as well.
Comment #94
joelpittetSeems to be only related to the Apache 2.4 workarounds. And I was able to reproduce it submitting any form in the admin page.
I'm re-opening this issue to address that.
Comment #95
joelpittetIt probably needs this looooong exclusion condition as well on that workaround:
Comment #96
Christopher Riley CreditAttribution: Christopher Riley commentedI have that long line in their already it is only if I change the / to a - in the first workaround that I do not seem to have the 500 error. What is the / supposed to do?
Thanks
Comment #97
aitala CreditAttribution: aitala commentedI am running Apache/2.4.6 (CentOS) and if I uncomment the search box fix
I get 500 error when I try to log in to the site. Without uncommenting it, the search box does not work for anon users.
The server is also behind a proxy...
Eric
Comment #98
smitty CreditAttribution: smitty commentedI am not sure if I have the same problem: As soon as I change the php version to 5.4 (tested with 5.4.9 and 5.4.16) the cached filed get not generated any more. Php-versions 5.2 and 5.3 are working like a charm.
Comment #99
NIKS_Artreaktor CreditAttribution: NIKS_Artreaktor commentedRunning Apache 2.2.2
Php 5.5
The same situation like in #97
Search page didn't tested - i don't using it.
Old htaccess rules - worked fine...
And also - there was # GZIP part.
In new code no # GZIP code.
It is need to?
Comment #100
Anonymous (not verified) CreditAttribution: Anonymous commentedPer #74 and #89 above.
I had the 500 error show when trying to save blocks and nodes.
I'm using Boost 7x-1.2
Drupal 7.54
Apache 2.4.16
PhP 5.6.15
Different than the Boost .htaccess generator page states, I returned to my .htaccess file and left the two areas of "apache 2.4 work arounds" commented OUT.
Doing that got rid of the 500 error problem for me.
If this is strictly an Apache thing, and there was some version that finally got rid of the involved Apache bug, it seems that the generator page remarks should be updated.
Comment #101
antims CreditAttribution: antims commentedThis will sever front page search problem:
function themename_form_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
switch ($form_id) {
case 'search_block_form':
if (drupal_is_front_page()) $form['#action'] = '/search';
break;
}
}
Comment #102
quinns CreditAttribution: quinns commentedAs per #101, that didn't work for me but changing the form action like so worked:
Another option that should work is using jQuery to adjust the form action:
$('body.front form#search-block-form').attr('action', 'search/node');
Comment #103
smitty CreditAttribution: smitty commentedI just had another look into this problem, when I did the update von 1.2.
My advice: Take the code generated by the boost-Module (1.2), keep the two Apache 2.4 bug workarounds commented out and change the line
RewriteRule .* - [S=2]
into
RewriteRule .* - [S=1]
With this change, all involved problems ( the problem of this issue + https://www.drupal.org/node/2421879 + https://www.drupal.org/node/2719795) are gone!
Related issue: https://www.drupal.org/node/2814113
Comment #104
philsward CreditAttribution: philsward commentedComment #105
marcoka CreditAttribution: marcoka commentedis this going to make it into a release? As pointed out, boost is broken OOTB because of that small directive
Comment #106
VARONI CreditAttribution: VARONI commented#103 solution worked for me.
Comment #107
Juan Lu CreditAttribution: Juan Lu commentedHola
Tengo el problema de cache. A mi me genera el fichero de cache con cada acceso lo cual quiere decir que no tira de cache D7
Uso php 7.2
Apache 2.4.29
D7.60
He probado cambiando algunas de las lineas del fichero .htaccess y aplicando alguna solución de las que vi en la comunidad pero el resultado es él mismo.
A alguien más le pasa esto ?
Comment #108
jukka792 CreditAttribution: jukka792 as a volunteer commentedHi,
html files are saved to server, and they are updated after every refresh.
Still I think the server is not serving any files, I cant see the boost header or the code in the source.
I have apache 2.4.33
What could be the solution, or is there any. Only when apache bug lines are commented out, no 500 server error comes.