Home Private Messages Search
CPG Dragonfly™ CMS
Toggle Content
 
Forums ⇒ Support ⇒ Troubleshootings ⇒ 2 sites using the same db


2 sites using the same db
Have you run into a problem, such as receiving an error, blank page, or other similar issue?
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  Troubleshootings

View previous topic :: View next topic  
Author Message
millzee
Newbie
Newbie

Offline Offline
Joined: Oct 04, 2008
Posts: 21
Location: uk
PostPosted: Mon Apr 25, 2011 12:55 pm
Post subject: 2 sites using the same db

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
Back to top
View user's profile Visit poster's website
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 555
Location: CO
PostPosted: Mon Apr 25, 2011 4:15 pm
Post subject: Re: 2 sites using the same db

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)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
millzee
Newbie
Newbie

Offline Offline
Joined: Oct 04, 2008
Posts: 21
Location: uk
PostPosted: Mon Apr 25, 2011 6:40 pm
Post subject: Re: 2 sites using the same db

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
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 4173
Location: Italy
PostPosted: Tue Apr 26, 2011 12:50 am
Post subject: Re: 2 sites using the same db

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
Back to top
View user's profile Visit poster's website Photo Gallery
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 555
Location: CO
PostPosted: Sat May 14, 2011 4:56 am
Post subject: Re: 2 sites using the same db

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)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
millzee
Newbie
Newbie

Offline Offline
Joined: Oct 04, 2008
Posts: 21
Location: uk
PostPosted: Tue May 31, 2011 12:45 pm
Post subject: Re: 2 sites using the same db

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
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  Troubleshootings
Page 1 of 1
All times are GMT



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


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Mercurial Commits
· Bugfix: \Poodle::getKernel()->IDENTITY can be undefined in debugger Change: spli
· Changed another L10N->get() to L10N->dbget() for CFG->global->slogan and CFG->gl
· Changed L10N->get() to L10N->dbget() for CFG->global->slogan and CFG->global->si
· Improved L10N admin
· Update version due to L10N changes
· Bugfix: L10N date parsing Added: L10N dbget() check v9 constants
· Merge
· Bugfix: new language system incompatibilities
· Dragonfly_Page namespaced and closed http://dragonflycms.org/Projects/f=143.html
· Bugfix: Statistics module missing properties

read more...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy