Install CMSMadeSimple to another directory...

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Install CMSMadeSimple to another directory...

Post by wms »

Hey,

I installed CMSMadeSimple to it's own directory /cmsmadesimple.  Reason I would like the cms in it's own folder is because I have several directories under my resellers hosting account that represents different client domians [e.g. root=http://mydomain, root/dir1=http://client1.com, root/dir22=http://client2.com, etc...you get the picture I'm sure].  So I would like to have a cmsmadesimple directory under each client directory [or account] for them to use.

Question, is there a way to have one installation of cmsmadesimple to point to different db's or do I have to have what I mentioend above?

----
Right now, I get the following error for the file-manager with cmsmadesimple in it's own directory, [i.e. not installed on the root]:

Warning: main(e:\web\public_html\awchurch\cmsmadesimple/lib/filemanager/filetypes.inc.php): failed to open stream: No such file or directory in e:\web\public_html\awchurch\cmsmadesimple\admin\files.php on line 24

Fatal error: main(): Failed opening required 'e:\web\public_html\awchurch\cmsmadesimple/lib/filemanager/filetypes.inc.php' (include_path='.;c:\php4\pear') in e:\web\public_html\awchurch\cmsmadesimple\admin\files.php on line 24
----

Any help for this total newbie would be muchly appreciated. ??? ??? ???
jelle

Re: Install CMSMadeSimple to another directory...

Post by jelle »

I did just that the other day. You will have to change one file (fileloc.php) in the distribution that determines where the configfile is located.
I changed it to look like this:

Code: Select all

<?php
#allow for more sites to use the same software by using different config.php's
$customconfig = dirname(__FILE__) .'/'. strtolower($_SERVER['HTTP_HOST'] . '-config.php')
;
#if (file_exists(strtolower($_SERVER['HTTP_HOST']).'-config.php')) {
if (is_readable($customconfig)) {
    define("CONFIG_FILE_LOCATION", $customconfig);
} else {
    define("CONFIG_FILE_LOCATION", dirname(__FILE__).'/config.php');
}
define("TMP_CACHE_LOCATION", dirname(__FILE__).'/tmp/cache');
define("TMP_TEMPLATES_C_LOCATION", dirname(__FILE__).'/tmp/templates_c');
define("LOG4PHP_LOGDIR", dirname(__FILE__).'/tmp/cache');
define("LOG4PHP_CONFIGURATION", dirname(__FILE__).'/lib/log4php/log4php.properties');
require_once(dirname(__FILE__).'/lib/log4php/LoggerManager.php');
?>
now you can point all your domains to the same directory, just have configs for the separate domains that point to different datatbases (or maybe different prefixes might work too). The other thing you will have to do is make sure that the temp and upload directories mentioned  in the config file are different for each domain. You don't want each client to share eachothers uploads do you?
You might want to use some apache aliases for that so that /path/to/directory/of/client1/uploads looks like clientdomain/uploads on the http side.
moving your config.php aside will trigger a new install (if the install directory is available) this will fill a new clean db for you. rename the new config.php to clientdomain.php and tweak the tmp and upload stuff.

As always, this code works for me, but it may very well bite you or insult your sundayschool teacher. :)
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Install CMSMadeSimple to another directory...

Post by wms »

Thanks Jelle....I'll try that....sounds good...well, until I try it I'm sure...newbie's.. ::)

I might come back with a couple of questions later if I can't get that working if you don't mind.

Thanks again for the quick response.  I've been looking for something over a month and a half and I think I might be close with CMSMadeSimple.  The forums are very friendly as well.

Thanks again!! ;) !!
jelle

Re: Install CMSMadeSimple to another directory...

Post by jelle »

Howcome do you classify yourself as a newbie while having at least several clients? :)

Anyway, just pm me if have a question, I'll answer if I got the time.
jelle

Re: Install CMSMadeSimple to another directory...

Post by jelle »

That reminds me, I had put a feature request bug in with a previous version that did not work yet, I'll attach in a new diff that works...
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Install CMSMadeSimple to another directory...

Post by wms »

Thanks Jelle and Patricia,

Newbie when it comes to CMSMS...as for HTML no...I think I can handle my own.  That's about it.  I do have several clients [about 6..lots so far for me :)], but basic html and some nice graphics and that's about it.

I'm venturing out a bit and starting a web design business on the side with my wife.  What I'm researching, CMS will keep you a float in the future.

Right now, I'm spinning my wheels trying to figure out how to use the template.  A couple of hours of effort in it, and still quite lost.  But hopefully the light will come on soon ???.

Thanks for your help again, and when I figure out how to use the template to fit my needs, I'll be attempting your solution.  I appreciate the offer as well to ask more question.

CMS newbie :-[
jelle

Re: Install CMSMadeSimple to another directory...

Post by jelle »

the afore mentioned patch still leaves some things to be desired. The attached might work better (disclaimer: it will go through your dirty laundry too. test dilligently before using it anywhere near production)

This patch is for 0.12beta 2 and will not apply cleanly to 0.11. That code still has some other issues with multi domain usage (image manager for instance)

[attachment deleted by admin]
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Install CMSMadeSimple to another directory...

Post by wms »

Thanks Jelle....I'll give this a shot....but I'll warn ya...I may have some questions ::)
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Install CMSMadeSimple to another directory...

Post by wms »

Ok...I've created the new fileloc.php file, and a seperate config.php file.

Now how do I log into the different admin panels?

My setup is:

/root = mydomain.ca
/client1 = client1.ca

I put a client1config.php into /client1 and created the fileloc.php file.  I'm lost on what to do next.  Do I need to create a seperate db for client1 as well?

Any help as always is great :-\ ;D
jelle

Re: Install CMSMadeSimple to another directory...

Post by jelle »

ah, some foolhardy guineapiglet :)
the idea is that all domains have the same documentroot. but they should have different /tmp/*  and upload directories, and getting those right takes some fiddling...

Have you applied the whole patch? It is more than just fileloc.php that has been touched by it.

The structure for the temp directories is the same as in tmp, but with the domainname inserted like tmp/yourdomain.ca/templates.
you will have to make this structure first, and make it writable. (maybe only two of those are needed, the installer only tests for two. The uploads directory needs something similar, but I think you can do define that to your liking in the config file afterwards.
then you put a writable empty file in the (document)root, with the name yourdomain.ca-config.php. At first you will not need to put anything in there, as long as its writable and you have the installer handy.
Accesing your domain will have this effect: fileloc and following notice that there is a domain specific configfile, but it being empty triggers the install procedure. You can go trough the normal steps here  either create a new db specific for this experiment, or reusing a existing db and not overwriting the tables. The final step in the install will write a preliminary config file for you.
You will have to edit this file by hand to specify a different locating for the uploads and images/uploads. Notice that you can use an alias in your virtualhost section (or maybe .htaccess) to make the external name for it a bit shorter.  preferably these directories should be outside the document tree, so that you cannot access the file with client1-domain/uploads/client2name/.

That should do it I think, but especially the last part, may still ahve some troubles. Any modules that do not honour the tmp locations but generate their own from config['root_path'], and use recurring filenames, will spoil your dinner.

The trick with fileloc will also apply to the admin section, so when you go to client1domain.ca/admin you get the admin section for client1, and client2.ca/admin gets the admin section for client2.

let me know how it goes. I've tested this whit only two local domains, but have not yet found problems with them.
Locked

Return to “[locked] Installation, Setup and Upgrade”