Closed (fixed)
Project:
Boost
Version:
6.x-1.18
Component:
Installation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2011 at 22:44 UTC
Updated:
16 Feb 2011 at 20:51 UTC
Hi there,
We have a rather large drupal 6 multisite installation, that utilises subfolders rather than sub domains. I noticed when reading the features of boost, it said it supports multisite installs, and subfolder installs.
My question is, has anyone had any luck getting a multisite subfolder installation working with boost?
The current rewrite rules in order to get the this working with apache:
Alias /phonebook /opt/drupalfiles/vhosts/intranet
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/phonebook/(.*)$
RewriteRule ^(.*)$ /phonebook/index.php?q=$1 [L,QSA]
Any help would be appreciated
Comments
Comment #1
mikeytown2 commentedCan I get a overview of how everything fits together? I haven't tested multisites via sub folders. So you have to change core's htaccess rules in order to get this working, correct?
Comment #2
wiifmHi Mike,
Correct, core drupal .htaccess does not cope with multisites under sub folders.
The tutorial I followed a while back that inspired me to do this was here - http://www.drupalcoder.com/story/205-drupal-multisite-in-subfolders.
In essence for every site (in the sub folder), you need 1x Alias apache directive and 1x rewrite rule (similiar to core drupal)
We are currently trying various combinations of rewrite rules to try and get boost to work. Items that may be of interest, when visiting the PHP info page in drupal for example, the REQUEST_URI variable still contains the initial sub folder:
hope this helps, and thanks for the fast response
Comment #3
mikeytown2 commentedfirst up; this rule should handle all your sub dirs. Untested, but should work.
Secondly I need some example URLs, sites dir used & file generated. Example:
URL: example.com/subdir1/front
DIR: /var/www/sites/mydrupalsite.com.subdir1/
FILE: /var/www/cache/normal/subdir1/front_.html
Comment #4
wiifmHi Mike,
URL: http://intrastg01.ird.govt.nz/phonebook/search/apachesolr_search
DIR: /opt/drupalfiles/vhosts/intranet/sites/intrastg01.ird.govt.nz.phonebook
FILE: /opt/drupalfiles/vhosts/intranet/cache/normal/intrastg01.ird.govt.nz/phonebook/search/apachesolr_search_.html
So it looks like boost is creating the static files
Comment #5
wiifmNote -
DIR is actually a symlink pointing at
/opt/drupalfiles/vhosts/intranet/sites/phonebook
The above path is the actual directory.
Comment #6
mikeytown2 commentedOne more bit of info; What does this spit out on your server?
Comment #7
wiifmI'll do you one better, this is the output of phpinfo();
Comment #8
mikeytown2 commentedI think the htaccess generator should work for you.
Go to the very bottom of admin/settings/performance/boost and change Document Root: to "/opt/drupalfiles/vhosts/intranet"
Then go here and try out the rules. Copy paste in
admin/settings/performance/boost-rules
Comment #9
sunshinewellington commentedHi Mike,
I'm Vincent, working with Sean! Implemented your suggestion of changing the document root, here's
below the resulting code.
Tried this and the Apache still not rewriting to the boost static file.
Also, noticed that the cache folder is located at:
/opt/drupalfiles/vhosts/intranet/cache NOT
/opt/drupalfiles/vhosts/intranet/phonebook/cache
We've included this into the vhosts configuration instead of .htaccess, does this make it different?
Comment #10
mikeytown2 commentedNew rules with phonebook removed. This means that one set of rules should work for all your sub directories.
Vhosts shouldn't make a difference. If it does let me know.
Comment #11
wiifmIt works!
Thanks Mike, this seems to have cleared things up, anonymous users now get boost cached files instead of hitting drupal ;)
Any chance a tweak could be made to boost to enable boost to work multisite subfolder installations out of the box ?
Thanks
Sean
Comment #12
mikeytown2 commentedThe main thing is DOCUMENT_ROOT is not set correctly because of the alias usage in your apache configuration. You had to change the htaccess rules to get this working correctly; I don't want to spend the time to program up a way to correctly detect non standard install like this. In terms of Boost, another option is to define the document root as an environmental variable like this
There's a good chance the rules generation would have picked this up and given it to you as an option then. It would show up like
%{ENV:boostdocroot}. The new rules using this would look like this.Anyway long story short using symlinks would probably work better.
http://drupal.org/getting-started/6/install/multi-site look under "Subdirectory multi-site"
Comment #13
wiifmThanks for all your help Mike,
You are right the symlink in the root of the drupal install pointing the 'subfolder' back to the base would avoid all of these alias commands and boost would just work.
Am very happy with the workaround provided though, and we will investigate the new environment variable to see if this can help
Thanks again
Sean
Comment #15
plaverty commentedOk, I'll be the latest to ask about this here. We're running a multi-site instance with subdirectories and we can't get boost to write the normal files. We see it writing the js and css, but not the content files. One thing that we see when we run cron is we get the warning that it's not a good idea to have safe mode on while running boost. But we have safe mode off for the entire server. We're not sure how that is getting triggered, or if that is even the trouble. My cache dir is writeable by the web server. My BOOST - HTML - DEFAULT MAXIMUM CACHE LIFETIME: is set to 1 minute.
Anything else obvious that I should be checking for?
Thanks!
Comment #16
plaverty commentedFigured it out...