Jump to content


Photo

Problems setting up multisite


  • Please log in to reply
23 replies to this topic

#1 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 02:09 AM

Hi guys, I'm having problems setting up a multisite instance. I have followed the instructions here: http://processwire.c...i-site-support/ and can access my main site fine.

However, my sub site located in site-[domain] throws this error when visiting its domain name (I have changed the http root - just in case):
Error Exception: DB connect error 2005 - Unknown MySQL server host 'Config' (0) ([root]/wire/core/ProcessWire.php line 95)

My error logs show:
? http://www.ray-dale.com/?/ Error Exception: Unknown column 'fieldgroups_fields.data' in 'field list' (in [root]/wire/core/Database.php line 118)

Does anyone have any ideas?

#2 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 14 May 2012 - 02:42 AM

Apparently your db host is not well set in the config.php file. You have it set to "Config"?

#3 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 02:58 AM

Thanks for the response Diogo. Hmm, the config is setup fine it seems. I have the correct dbHost, dbName etc for the subsite.

Part of the recommended setup process in the instructions I link to involve actually installing the subsite as a normal seperate pw site first under a sub directory. This all worked fine with a separate database and site being setup under the temp directory as per the suggestion.

#4 Soma

Soma

    Hero Member

  • Moderators
  • 3,205 posts
  • 1757

  • LocationSH, Switzerland

Posted 14 May 2012 - 03:09 AM

What versions are you running? I think "fieldgroups_fields.data" was added at some point in 2.2.

@somartist | modules created | support me, flattr my work flattr.com


#5 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 03:36 AM

Hi Soma, I have just upgraded (the main site) to version 2.2.

Edit: I upgraded the main site to 2.2 last night before installing the new sub site (again v 2.2).

#6 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 14 May 2012 - 04:14 AM

I also have multisite installed in my server, and did a small test now. I was able to reproduce the message you get on the browser "Error Exception: DB connect error 2005 - Unknown MySQL server host 'Config' (1) (in /srv/www/diogoo.com/public_html/wire/core/ProcessWire.php line 95)" by mistyping the name of the subsite folder on the "index.config.php" file.

make sure that you have it like this:
'domain.com' => 'folder-name',
the folder name should be something like "site-whatever"

EDIT: I suspect the error log is older than this. Can you check the date?

#7 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 04:40 AM

Thanks for testing Diogo.

Ah yes, the error log is too old to be relevant. So, that leaves the error exception shown in the browser: Error Exception: DB connect error 2005 - Unknown MySQL server host 'Config' (0) (in /home/raydale/public_html/wire/core/ProcessWire.php line 95)

I have setup 'site-foldername' correctly in the index.config.php file it seems.

I also get 'This error message was shown because Superuser has never logged in. Error has been logged.' underneath the error exception message, but I haven't had any error messages logged. Not sure if this gives any more clues?

#8 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 14 May 2012 - 04:58 AM

I have setup 'site-foldername' correctly in the index.config.php file it seems.

Still, it does look like the problem must be here. Somehow, the config is not pointing to the correct folder.


but I haven't had any error messages logged


This would be a consequence of the first problem. If PW doesn't know the way to the folder, it can't put any log there.

You said you set up 'site-foldername', that must be the problem. The folder must be called 'site-something', 'site-' must be part of the folder name. Do you have it like this?

EDIT: I even tested removing the "site-" part of the folder and also on the config, and it still works (@Ryan, is there any special reason for requiring this on the instructions? Or is it just for organizational purposes?)

#9 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 05:18 AM

I'm sure you are right - I must be doing something wrong. Maybe I have missed something basic. My settings in the config file are:
'ajs-decorator.co.uk' => 'site-ajsdecorator',
'www.ajs-decorator.co.uk' => 'site-ajsdecorator',

I have a directory setup as: 'site-ajsdecorator'. In this directory is the 'site' directory as required.

I have also double checked that I have the latest v2.2 htaccess file (which I do).

#10 Soma

Soma

    Hero Member

  • Moderators
  • 3,205 posts
  • 1757

  • LocationSH, Switzerland

Posted 14 May 2012 - 05:23 AM

I have a directory setup as: 'site-ajsdecorator'. In this directory is the 'site' directory as required.


I've never used this multi site setup, but I think that's wrong. You don't need a "site" folder inside your "site-something" folder.

@somartist | modules created | support me, flattr my work flattr.com


#11 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 14 May 2012 - 05:33 AM

You don't need a "site" folder inside your "site-something" folder.


Yep, that's the problem. Move all the content from this 'site' directory one level up, to the 'site-ajsdecorator' directory, and it should be fine.

#12 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 06:02 AM

HAHA!!!

Thanks very much for your patience Diogo and Soma! It works now.

I have looked through the instructions again and it does clearly state 'Once installation has completed, move or rename the /tmp/site/ directory to a /site-name/ directory in your main ProcessWire installation'.

Of course being an idiot I scan read the steps and ended up just putting the 'site' folder INTO a 'site-name' directory. I hope this helps anyone else coming across this problem.

Thanks again guys.

#13 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 14 May 2012 - 06:05 AM

Nice :)

#14 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 08:52 AM

EDIT: I even tested removing the "site-" part of the folder and also on the config, and it still works (@Ryan, is there any special reason for requiring this on the instructions? Or is it just for organizational purposes?)


I found this earlier testing combinations of directory naming structure in the index.config.php and thought I had messed something else up :-[ . I have reverted to using the 'site-something' naming convention for organisation, but I would still be interested to know if directories can be more 'loosely' named like this?

#15 ryan

ryan

    Hero Member

  • Administrators
  • 5,780 posts
  • 3124

  • LocationAtlanta, GA

Posted 14 May 2012 - 12:25 PM

(@Ryan, is there any special reason for requiring this on the instructions? Or is it just for organizational purposes?)


The "site-" at the beginning is required because the .htaccess file knows to block access to sensitive directories/files below all directories beginning with "site-". So while you could use a different naming structure, you'd have to make a lot of changes to your .htaccess file in order to make it secure.

#16 raydale

raydale

    Distinguished Member

  • Members
  • PipPipPipPip
  • 100 posts
  • 46

Posted 14 May 2012 - 03:49 PM

Thanks Ryan, it's always good to know the 'why' as my education in PW continues.

#17 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 14 May 2012 - 03:52 PM

same here!

#18 RJay

RJay

    Jr. Member

  • Members
  • PipPip
  • 24 posts
  • 4

Posted 15 May 2013 - 02:48 PM

I think my post here was better suited for this topic. From all the examples I have seen, you cannot use sub-folders but just different domains and sub domains. Would that be correct?



#19 diogo

diogo

    Hero Member

  • Moderators
  • 2,008 posts
  • 1089

  • LocationPorto, Portugal

Posted 15 May 2013 - 04:12 PM

I think so, Rjay. This is only for different domains.



#20 RJay

RJay

    Jr. Member

  • Members
  • PipPip
  • 24 posts
  • 4

Posted 15 May 2013 - 07:03 PM

Thanks diogo, it would be nice to have either option, but I could see how it could cause some problems. 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users