raydale Posted May 14, 2012 Share Posted May 14, 2012 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? Link to comment Share on other sites More sharing options...
diogo Posted May 14, 2012 Share Posted May 14, 2012 Apparently your db host is not well set in the config.php file. You have it set to "Config"? Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 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. Link to comment Share on other sites More sharing options...
Soma Posted May 14, 2012 Share Posted May 14, 2012 What versions are you running? I think "fieldgroups_fields.data" was added at some point in 2.2. Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 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). Link to comment Share on other sites More sharing options...
diogo Posted May 14, 2012 Share Posted May 14, 2012 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? Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 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? Link to comment Share on other sites More sharing options...
diogo Posted May 14, 2012 Share Posted May 14, 2012 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?) Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 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). Link to comment Share on other sites More sharing options...
Soma Posted May 14, 2012 Share Posted May 14, 2012 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. Link to comment Share on other sites More sharing options...
diogo Posted May 14, 2012 Share Posted May 14, 2012 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. Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 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. 2 Link to comment Share on other sites More sharing options...
diogo Posted May 14, 2012 Share Posted May 14, 2012 Nice Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 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? Link to comment Share on other sites More sharing options...
ryan Posted May 14, 2012 Share Posted May 14, 2012 (@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. 2 Link to comment Share on other sites More sharing options...
raydale Posted May 14, 2012 Author Share Posted May 14, 2012 Thanks Ryan, it's always good to know the 'why' as my education in PW continues. Link to comment Share on other sites More sharing options...
diogo Posted May 14, 2012 Share Posted May 14, 2012 same here! Link to comment Share on other sites More sharing options...
RyanJ Posted May 15, 2013 Share Posted May 15, 2013 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? Link to comment Share on other sites More sharing options...
diogo Posted May 15, 2013 Share Posted May 15, 2013 I think so, Rjay. This is only for different domains. Link to comment Share on other sites More sharing options...
RyanJ Posted May 16, 2013 Share Posted May 16, 2013 Thanks diogo, it would be nice to have either option, but I could see how it could cause some problems. Link to comment Share on other sites More sharing options...
RyanJ Posted May 16, 2013 Share Posted May 16, 2013 Is it possible to set up the sub domain multisite on wamp? Link to comment Share on other sites More sharing options...
diogo Posted May 16, 2013 Share Posted May 16, 2013 I guess so: http://blog.smriyaz.com/how-to-create-virtual-hosts-in-windows-wamp-server/ Link to comment Share on other sites More sharing options...
RyanJ Posted May 16, 2013 Share Posted May 16, 2013 (edited) Hi Diogo, Thanks for the quick response and link. I was still unable to get the subdomain to work properly. I think I will just do a new pw install on my local and export it to the live sub domain db when I am done. Sounds like it might be easier and quicker Thanks again. After looking at the apache error log, it looks like it was looking for the subdomain folder within the wamp/www/ directory. Note sure how to get around that. I had also misunderstood the forwarding of the sub-domain as well and think this is only possible by creating a new dns record. I would be curious if any others have manged to set it up on a local environment. Or I could be completely over my head (which is more likely possible) Edited May 17, 2013 by RJay Link to comment Share on other sites More sharing options...
RyanJ Posted May 20, 2013 Share Posted May 20, 2013 (edited) Would really like to know if any was able to get option 1 here working with hostgator? I have set up everything perfectly, but for some reason it does not want to point the sub-domain. Update! After banging my head for a few days. To "point" a domain in most shared hosting accounts is to "park" a domain. Now that I feel dumber , I hope someone else will find this useful. It works perfectly! Edited May 21, 2013 by RJay 2 Link to comment Share on other sites More sharing options...
nfil Posted August 4, 2013 Share Posted August 4, 2013 Would really like to know if any was able to get option 1 here working with hostgator? I have set up everything perfectly, but for some reason it does not want to point the sub-domain. Update! After banging my head for a few days. To "point" a domain in most shared hosting accounts is to "park" a domain. Now that I feel dumber , I hope someone else will find this useful. It works perfectly! thanks Rjay for this last update I had my second domain as an add On Domain and it didn't work, now the second domain is working as a parked one. I still have to "hide" the site-otherdomainname folder if you go to the http://site.com/site-otherdomainname you can see the contents, so probably you will have the same content indexed twice. Doing a 301 redirect for that folder, on the .htaccess it will get the wrong path for the content (css,js) of site-otherdomainname. Redirect 301 /site-otherdomainname http://site-otherdomainname On the topic of parked and addOnDomains This didn't work for me: On my server's pulbic_html folder I have two folders: site site-otherdomainname Then also on the public_html folder I have this pWire files: .htaccess (no 301 redirects at the moment for this www.otherdomainname.com ) index.php index.config.php 'otherdomainname.com' => 'site-otherdomainname', 'www.otherdomainname.com' => 'site-otherdomainname', /* * Default for all others (typically /site/) * */ '*' => 'site', Then I have two databases one for the main site domain, this one is working and other for the site-otherdomainname on this lasts domain folder I have the config.php file with the same sql user but different databases. $config->dbHost = 'localhost'; $config->dbName = 'serverusername_otherdomainname'; $config->dbUser = 'serverusername_aamulti'; $config->dbPass = 'dbpassword'; $config->dbPort = '3306'; This otherdomainname.com was added as a add On Domain on cPanel, it outputs a 500 error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now