I've configured Boost in accordance with the readme file. When I point my browser at the home page, a cached file (_.html) is created with the full HTML including the Boost footer. However, when I return to the home page, I receive a blank white page. Using view source, I see the following (which is different than the other white page issues that I've seen):
<?php
/**
* @file
* The PHP page that serves all page requests on a Drupal installation.
*
* The routines here dispatch control to the appropriate handler, which then
* prints the appropriate page.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();This occurs in IE, Firefox, and Chrome. My .htaccess file is the following:
FileETag MTime Size
<FilesMatch "\.(html)(\.gz)?$">
<IfModule mod_expires.c>
ExpiresDefault A5
</IfModule>
<IfModule mod_headers.c>
Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
Header unset Last-Modified
Header append Vary Accept-Encoding
Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
Header set X-Cached-By "Boost"
</IfModule>
</FilesMatch>
<IfModule mod_mime.c>
AddCharset utf-8 .html
AddEncoding gzip .gz
</IfModule>
<FilesMatch "\.html(\.gz)?$">
ForceType text/html
</FilesMatch>
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinksI've tried this using Drupal 7.22 and 7.23. I've also reproduced it with a clean install of Drupal. I can access the cached file directly and it looks fine.
Cache pages for anonymous users is unchecked under performance. The server housing the Drupal instance has 1.7GB RAM and Drupal is the only significant application running on the server.
There are no watchdog entries when the white page shows up:
I've been trying to figure it out over the last couple of days. Any suggestions?
Thanks.
Matthew
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | apache.zip | 1.93 KB | kerasai |
Comments
Comment #1
Anonymous (not verified) commentedA blank page is the default setting for a PHP crash and that should show you where the error occurred.
Comment #2
mhelm commentedThanks for the quick response! I tried out your steps and this is what was written to the apache error log --
Should I look at another log file or increase the logging level?
Comment #3
mhelm commentedIn doing a little more testing, this problem is only happening with the _.html file. If I navigate to a new page and a cached page is created and I return to that cached page, I see the rendered page fine with the Boost footer. However, any time that I do it with the _.html file, I encounter the error.
Comment #4
Anonymous (not verified) commentedDebugging will still be the same, you'll need to find something in either /etc/httpd/vhosts.d (fedora) or /etc/apache/sites-enabled (debian/ ubuntu), cpanel or whm have their own systems that generally rely on some variation on the domain name for the log file name.
Comment #5
kerasai commentedI'm experiencing the same this as @mhelm in his original report and #3. I think this has to do with something weird in the way Apache is handling the rewrites.
I've tried all sorts of things but unfortunately I haven't been able to figure out exactly how to handle it. Here are some notes.
I'm running Drupal 6.28 with Boost 6.x-1.21.
Not seeing anything in the Drupal, PHP, or Apache logs. Also not sure that there actually is an error, just a bug or configuration issue with some piece of the stack.
Tried setting RewriteBase, didn't have any effect.
If I change
to
the home page renders, but is generated by Drupal--not served from the Boost cache file. This makes me think Apache somehow "misses" the cached file on the rewrite and tries to fire up the 404 ErrorDocument, which is index.php. When the type is specified as text/html the contents of index.php is rendered, when not specified it's interpreted as PHP and Drupal does its thing.
I've tried putting in a separate rule to catch the home page and route it to the appropriate cache file, no good. Checking for request uri of "/" it doesn't do anything, checking for request uri of "/index.php" it routes everything to the _.html cache file. I suppose I could get into parsing query string, but shifting bits like this hasn't been necessary on any other implementations I've run so that makes me hesitant to go down that road.
Not sure what to make of all this. Would appreciate any ideas.
Comment #6
Anonymous (not verified) commentedI'd disable the modules you have installed one by one to check if there is anything that is causing this.
To get a temporarily working site, If other pages are caching correctly then to get a working site I would use the Cache specific pages and set it to ignore index.php.
It would be unlikely to be the rewrite rules feeding back through to index.php, since all the correctly generated pages have already been through that process, so it's something specific to the index page itself.
Off the top of my head then a likely explanation would be a redirect from example.com to www.example.com, which would generate no output. This could be tested by turning off boost and checking the headers through firebug and seeing if there is a 302 sent for one domain or the other and then confirming that the .htaccess is correctly configured with the redirect and boost sections in the correct place.
Comment #7
kerasai commentedI've done some more testing, can't figure out exactly what the problem is, but I'm confident that it's Apache configuration of some type. I've got 2 VPS's with similar configurations from the same host, one has the problem the other does not. I've provided them with this information, so hopefully they'll have some useful input.
Please see the files attached below. It's effectively a static implementation of the Boost .htaccess action. If you'd like to try it out, unzip the contents of the zip into your webroot. It should look like this:
/path/to/webroot/apache/index.php
From there you can replicate (or not) the error by visiting the following URLs:
http://example.com/apache/ - (Will be "blank" if you're experiencing the issue)
http://example.com/apache/a - (should see "cached" page A)
http://example.com/apache/b - (should see "cached" page B)
http://example.com/apache/c - (should see "cached" page C)
Comment #8
Anonymous (not verified) commentedHave you done a basic
to check the settings for DOCUMENT_ROOT etc? Are the servers identical, for example is there a variation in something like the php.ini file for cgi.fix_path_info ? Did you test whether a redirect was taking place as requested ?
Comment #9
kerasai commentedThe only glaring difference I see in phpinfo() is that one is running PHP via mod_php and the other is cgi.
The environment that is acting up is the one running PHP as cgi and it has cgi.fix_pathinfo = 1. The other environment doesn't have the value.
However I don't see anything that leads me to think Apache would handle the rewrite differently. Please let me know if there's anything else specifically that you'd like me to review.
Observations:
Comment #10
Anonymous (not verified) commentedAs you have a VPS you should be able to debug this better than a shared hosting environment. I have seen redirect blank pages before, the other item has been a cached PHP crash which is rarer but with this difference in PHP handling you should be able to to turn on the Rewrite log in your main apache configurations. But it is a little more complicated previously in Apache 2.2 you would use the RewriteLog and RewriteLogLevel directives.
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog
In apache 2.4 you'll need to use the loglevel as directed on these pages.
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
http://httpd.apache.org/docs/current/mod/core.html#loglevel
These need to be initiated not in a .htaccess file but in the main server configuration and then the server needs a restart. (hence why shared hosting makes things difficult). What you would be looking for is why there is a miss. Also one thing that confuses me, is what the blank page is. the -s flag in the rewrite condition is very specific in that the file must be greater than zero in length, so what is in the blank file ?
The other interesting possibility is that there is a crash due to a lack of mod_mime (though strictly you should have a 500 server error displayed), caused by the T=text/html flag which seems to make a difference. In a terminal you may want to try
apachectl -t -D DUMP_MODULESto check for differences in the modules for each installation as cgi based php cannot probe apache's loaded modules.
Comment #11
kerasai commentedThanks for the input @Philip_Clarke, I lack the expertise at that level of the stack to really attack this one. Also thanks for the diligent attention on this. I'm going to pass this info along to the host and continue poking at this. I'll let you know if/what we find.
Thanks again.