CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
Pages: [1]

Author Topic: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default  (Read 19190 times)

johnbarclay

  • I’m new here
  • *
  • Posts: 5
  • Karma: 1
Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 06, 2009, 01:22:57 pm
Love the new installer.   Had one problem though.

On a clean install of drupal 6.10 and civicrm 2.2 beta4, the install page at:

http://blah.com/sites/all/modules/civicrm/install/index.php

Assumes the default directory:
/sites/default/index.php

when it should be looking at
/sites/blah.com/index.php

And gives the following error:
Is the sites/default folder writeable?   The user account used by your web-server - myusername - needs to be granted write access to the following directory in order to configure the CiviCRM settings file:
/home/mysitename/illinoisdrupal6/sites/default

This correct path can be determined by replacing the getSiteDir() function in install/index.php with a slight modification of the conf_path() function in includes/bootstrap.inc

Patch is attached.  The patch version worked for me.  John
« Last Edit: March 06, 2009, 08:45:05 pm by johnbarclay »

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 17, 2009, 11:12:10 am
did this patch make it into 2.2.0 Stable?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 17, 2009, 12:18:39 pm

no, but if you file an issue and attach the patch we'll investogate and consider it for 2.2.1

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Bairnsfather

  • Guest
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 21, 2009, 03:52:20 pm
The above patch mostly worked for me.  The install screen could see the specific site directory, but the civicrm.settings.php was still created in the default folder instead of the specific site folder. This lead to the web site being, more or less, inaccessible.

So I created a patch for install/civicrm.php that causes the civicrm.settings.php to be created in the site's folder (not the default folder).


Bairnsfather

  • Guest
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 21, 2009, 04:15:06 pm
Frankly, if it hadn't been for John's first patch, I wouldn't have been able to make mine.  Bootstrapping newbie to civicrm and patching.

Since we're on this topic  ;D maybe I can get some related advice.  Basically I replaced $_SERVER['SCRIPT_FILENAME'] with $cmsPath.

I am wondering how many other places in civiCRM 2.2 it should be replaced.  An extensive search of all the former code reveals it to be in two other files:
File "/sites/all/modules/civicrm/CRM/Utils/REST.php"; Line 262:              $apiPath = substr( $_SERVER['SCRIPT_FILENAME'] , 0 ,-15 );
File "/sites/all/modules/civicrm/install/index.php"; Line 48:  $crmPath = dirname ( dirname( $_SERVER['SCRIPT_FILENAME'] ) );
File "/sites/all/modules/civicrm/install/index.php"; Line 56:      if ( ! preg_match('/sites.[a-zA-Z0-9_.]+.modules/', $_SERVER['SCRIPT_FILENAME']) ) {
File "/sites/all/modules/civicrm/install/index.php"; Line 594:          return dirname($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR;


Since I'm not all that versed in php I can't say I'm eager to replace each occurrence, any advice out there from those in-the-know would be great!

- TIA  Drew

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 23, 2009, 05:47:11 am
Multi-site support is already present in the installer.

But there is an assumption, it expects the 'modules/civicrm" directory to be present inside multi-site/ dir.

For example - in johnbarclay's case, if the url had been -
http://blah.com/sites/blah.com/modules/civicrm/install/index.php
the installer would definitely create "blah.com/sites/blah.com/civicrm.settings.php" file.

With "http://blah.com/sites/all/modules/civicrm/install/index.php" the thinking is - user expects settings file to be available to entire site or its a single site installation and therefore file is created in sites/default/ dir.

I think a better fix would be to check for the presence of multi-site dir when "all" is found in the url.
« Last Edit: March 23, 2009, 06:35:40 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Bairnsfather

  • Guest
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 23, 2009, 01:44:43 pm
Deepak, thanks for the insight.  I was not aware of these assumptions as I read through the install pages. :-)

Yes, my civicrm scripts are in /sites/all/modules/ folder, not in the /sites/blah.com/modules/ folder. 

Does this mean I should move the civicrm scripts to the /sites/blah.com/modules/ folder to prevent other problems I may encounter?  (No doubt folks are aware that the main reason for multisite is not having to maintain/upgrade multiple codebases.)

Quote from: Deepak Srivastava on March 23, 2009, 05:47:11 am
But there is an assumption, it expects the 'modules/civicrm" directory to be present inside multi-site/ dir.

… snip …

With "http://blah.com/sites/all/modules/civicrm/install/index.php" the thinking is - user expects settings file to be available to entire site or its a single site installation and therefore file is created in sites/default/ dir.


This last bit doesn't make a lot of sense to me because there is not one "entire site" in the above scenario, there are multiple Drupal sites.  Also, when I first upgraded to 6 and consolidated my Drupal code in to a multisite install, I found I could not get it to work unless I had a "default" folder but never expected it to be populated with stuff from specific site installs. 

I have not done much testing of civicrm, but your last statement makes it sound like one can have multiple Drupal sites and have them all access one civicrm database.  Is this true?  It seems like it could create havoc when it comes to synchronizing roles/users, at least.

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 24, 2009, 12:49:59 am
The question is more of - how the installer should distinguish a single-site install from multi-site install.

W.r.t maintaining single codebase, its more of a setup issue. I would just create a link -
sites/blah.com/modules/civicrm -> ../../all/modules/civicrm
i.e keeping the code in sites/all and still maintaining the single code base. And using "...sites/blah.com/modules/civicrm/install/" makes the installer very clear that user wants a site specific install.

Quote
This last bit doesn't make a lot of sense to me because there is not one "entire site" in the above scenario, there are multiple Drupal sites.
By entire site i mean "main site"/single site.

Quote
I have not done much testing of civicrm, but your last statement makes it sound like one can have multiple Drupal sites and have them all access one civicrm database.
True as long as its the same drupal db.

Just to not leave any confusion - the current behavior is : an url of format ".../sites/all/.." instructs the installer to do a single site installation.

And i also agree that there could be cases as discussed, where a multi-site install is expected (with url of above format). A better fix as i mentioned in this direction would be the one which checks for existence of multi-site dir, and if found creates settings file in that dir, otherwise goes with default.
If your patch does the same or you can provide one, file an issue and attach the patch and we 'll make the change for 2.1.2
 
« Last Edit: March 24, 2009, 07:41:35 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 24, 2009, 07:14:22 am
Nevermind, there has been a fix related to this - http://fisheye.civicrm.org/changelog/CiviCRM/branches/v2.2?cs=20406.

Would be great if any of you could apply the patch and see if it works. The entire file can also be picked up from - http://svn.civicrm.org/civicrm/branches/v2.2/install/
« Last Edit: March 24, 2009, 07:21:19 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Bairnsfather

  • Guest
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 26, 2009, 03:34:40 pm
Quote from: Deepak Srivastava on March 24, 2009, 07:14:22 am
Nevermind, there has been a fix related to this - http://fisheye.civicrm.org/changelog/CiviCRM/branches/v2.2?cs=20406.

Would be great if any of you could apply the patch and see if it works. The entire file can also be picked up from - http://svn.civicrm.org/civicrm/branches/v2.2/install/

I just applied the patch.  So far the installer shows everything green!  But at the bottom it is indicating "default" instead of the site specific folder, I will install now and see how things turn out.

Is the sites/default/files folder writeable?   OK
Is the sites/default folder writeable?   OK


Ok, just installed.  Sorry to say that the patch didn't put the civicrm folder inside the /sites/site-specific/files folder, but put it in the /sites/default/files folder.

However, my tiny patch did the trick.  But I am still wondering this: http://forum.civicrm.org/index.php/topic,6927.msg31541.html#msg31541

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default
March 27, 2009, 09:55:34 am
There was also another fix which could not make into 2.2.1 - http://fisheye.civicrm.org/changelog/CiviCRM/branches/v2.2?cs=20440
The fix uses drupal's way of finding out the site dir. Hopefully this should work. If it doesn't attach your patch :)

Would recommend to directly pick up the file from svn.

Quote
However, my tiny patch did the trick.  But I am still wondering this: http://forum.civicrm.org/index.php/topic,6927.msg31541.html#msg31541
The problem will not go away unless the installer puts the settings file in the proper site dir. Did you try linking from sites/SITE_DIR/modules/ as mentioned in http://forum.civicrm.org/index.php/topic,6927.msg31625.html#msg31625 ?
« Last Edit: March 27, 2009, 10:03:44 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Multisite Drupal 2.2 Beta4 Clean Install insists on /sites/all/default

This forum was archived on 2017-11-26.