Support ⇒ Troubleshootings ⇒ 2 sites using the same db ⇒ Community Forums ⇒ CPG Dragonfly™ CMS

2 sites using the same db Reply to topic

Author Message
millzee
Newbie

Offline Offline
Joined: Oct 04, 2008
Posts: 21
Location: uk

hi,

i need to have 2 sites on the same server (in separate folders) and 1 db.

to accomodate this, i've created 2 new fields in the cms_config_custom: so i have

server path = /dir1/
cookie path = /dir1/

server path2 = /dir2/
cookie path2 = /dir2/

what i'm trying to figure out is where can i change the settings within the site located in dir2 folder to pull the values from path2 instead of path.

I have looked at the admin/modules/settings.php

$sections = array(
array('global' => array('sitename', 'site_logo', 'slogan', 'startdate', 'adminmail', 'crumb', 'admin_help', 'update_monitor', 'GoogleTap', 'block_frames', 'Default_Theme'),
'server' => array('domain', 'path')),
array('global' => array('maintenance', 'maintenance_text')),
array('cookie' => array('server', 'domain', 'path', 'admin', 'member')),
array('global' => array('foot1', 'foot2', 'foot3')),
array('global' => array('backend_title', 'backend_language')),
array('global' => array('commentlimit', 'pollcomm', 'moderate')),
array('global' => array('CensorMode', 'CensorReplace')),
array('email' => array('allow_html_email', 'smtp_on', 'smtphost', 'smtp_auth', 'smtp_uname', 'smtp_pass')),
array('debug' => array('database', 'session')),
array('global' => array('banners', 'httpref', 'httprefmax', 'top'))
);

and changed the path to path2, unfortunately this doesnt resolve the problems i am experiencing.

site 1 works fine, site 2 keeps going over to site 1. I need to keep them seperate, but maintain 1 db.

any ideas?


millzee's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
x86/centro/5.1/5.2/9.2.3.3
View user's profileVisit poster's website
greenday2k
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 558
Location: CO

mmm have you tried to install DF on each folder just using a different database prefix (in that way you can share the db but not the tables... ).

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
View user's profileVisit poster's websiteYahoo Messenger
millzee
Newbie

Offline Offline
Joined: Oct 04, 2008
Posts: 21
Location: uk

thanks for the prompt reply greenday2k, unfortunately i need to share data in the tables as well between the 2 sites.


millzee's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
x86/centro/5.1/5.2/9.2.3.3
View user's profileVisit poster's website
NanoCaiordo
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 4202
Location: Italy

The proper way:

Admin -> Main Settings -> Cookies:
SERVER_NAME as Cookie Domain: No
else Cookie domain: leave it empty

If this isn't what you want or for some reason it doesn't work each site needs to be within its own fully qualified domain name.

example.com AND subdomain.example.com
OR
sub1.example.com AND sub2.example.com
OR
www1.example.com AND www2.example.com
etc etc

Use the above cookie settings for this kind of configuration but change cookie path from "path/" TO "/".

The other way:
To hard code your modifications into DragonflyCMS look in cmsinit.inc around line 110-130.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Linux 64bit / Apache 2.2 / PHP 5.4.9 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.19 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.19 / MySQL 5.5.22 / v9, v10




NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
View user's profileVisit poster's websitePhoto Gallery
greenday2k
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 558
Location: CO

nano that works.

I have just done with two different sites, and they seem to work fine.

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
View user's profileVisit poster's websiteYahoo Messenger
millzee
Newbie

Offline Offline
Joined: Oct 04, 2008
Posts: 21
Location: uk

thanks everyone, i went with nano's solution. works a treat.


millzee's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
x86/centro/5.1/5.2/9.2.3.3
View user's profileVisit poster's website
Display posts from previous:
All times are UTC



Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español