Forums / Install & configuration / One installation, multiple databases ?

One installation, multiple databases ?

Author Message

Thursday 24 April 2003 4:47:10 am

Hi,

Is it possible to run several subdomains with one installation but with separate databases ?

I've found http://ez.no/developer/ez_publish_3/documentation/ez_publish_3/howtos/several_sites_with_one_installation but it doesn't mention different databases.

Karsten Jennissen

Thursday 24 April 2003 4:49:15 am

You can make any settings in the sub domain specific files you want, including database settings.

Karsten

Bård Farstad

Thursday 24 April 2003 4:49:48 am

To run multiple databases on the same installation you need to configure the site access. The site access is used to separate the different sites. When for each site access you can override all settings, including database configuration.

So all you need to do is to create the proper site access configuration ( info in the manual ) and tune the database settings for that site access. These settings will be placed in e.g.
settings/siteaccess/mynewsite/site.ini.append

--bård

Documentation: http://ez.no/doc

Saturday 26 April 2003 9:25:38 am

I've got a little bit further. Now I can see different sites with content from different databases, but I can't get the admin site to load.
When I try to login to the admin site it gives me an error "Kernel. No database connection could be made, the system might not behave properly.".

I have removed all the [DatabaseSettings] from settings/override/site.ini.append.php and added those setting to my settings/siteaccess/site/site.ini.append.php file.

If I leave the [DatabaseSettings] settings in the settings/override/site.ini.append.php file the admin site will show that particular sitedatabase to all my sites.

Any ideas how to accomplish database separation would be appreciated.

Jeroen van Gorkum

Monday 28 April 2003 1:46:24 pm

> When I try to login to the admin site it gives me an error
> "Kernel. No database connection could be made, the
> system might not behave properly.".

i had that error when i used a fully qualified domain name as <accessname> value for the HostMatchMapItems[] directive. e.g.:

file: ezpublish-3.0-1/settings/override/site.ini.append.php

[SiteAccessSettings]
HostMatchMapItems[]=ez3test.vangorkum.com;ez3test.vangorkum.com
HostMatchMapItems[]=admin.ez3test.vangorkum.com;admin.ez3test.vangorkum.com

file: ezpublish-3.0-1/settings/siteaccess/ez3test.vangorkum.com/site.ini.append

[DatabaseSettings]
User=ez3test
Password=********
Database=ez3test

that doesn't work and displays above error. it works when i use a shorter name for <accessname> (and rename the subdirectory in siteaccess/)

[SiteAccessSettings]
HostMatchMapItems[]=ez3test.vangorkum.com;ez3test
HostMatchMapItems[]=admin.ez3test.vangorkum.com;admin.ez3test

hth,

jeroen.

Tuesday 29 April 2003 2:09:33 am

I tried that without any success.
They still use the same db.

Jeroen van Gorkum

Tuesday 29 April 2003 5:49:39 am

correction: after more testing it seems that the connection to the database always fails if it is done from a site.ini.append in a directory that contains a dot in its name.

so, `admin.ez3test.vangorkum.com' in my previous example doesn't work after all; it shows your error. it works if i replace the dot in <accessname> and the subdirectoryname with an underscore:

file: ezpublish-3.0-1/settings/override/site.ini.append.php

[SiteAccessSettings]
MatchOrder=host
HostMatchType=map
HostMatchMapItems[]=ez3test.vangorkum.com;ez3test
HostMatchMapItems[]=admin.ez3test.vangorkum.com;admin_ez3test
...

file: ezpublish-3.0-1/settings/siteaccess/ez3test/site.ini.append

[DatabaseSettings]
User=ez3test
Password=********
Database=ez3test
...

file: ezpublish-3.0-1/settings/siteaccess/admin_ez3test/site.ini.append

[DatabaseSettings]
User=ez3test
Password=********
Database=ez3test
...

configuration details:
* debian GNU/Linux 3 woody
* apache 1.3.26
* php 4.1.2
* mysql 3.23.49
* ez publish 3.0-1

jeroen.

Wednesday 30 April 2003 10:38:50 am

Thanks, I'll try that

Alexandre Cunha

Sunday 15 June 2003 6:38:24 am

Thanks Jeroen

Your setup works on windows too.

axel

http://AlexandreCunha.com

eZ debug

Timing: Jan 18 2025 11:38:13
Script start
Timing: Jan 18 2025 11:38:13
Module start 'content'
Timing: Jan 18 2025 11:38:15
Module end 'content'
Timing: Jan 18 2025 11:38:15
Script end

Main resources:

Total runtime1.8529 sec
Peak memory usage4,096.0000 KB
Database Queries218

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 589.2500180.8203
Module start 'content' 0.00801.6841 770.0703724.9688
Module end 'content' 1.69210.1607 1,495.0391340.4375
Script end 1.8528  1,835.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.2453210.0002
Check MTime0.00160.0886210.0001
Mysql Total
Database connection0.00180.096810.0018
Mysqli_queries1.748694.36962180.0080
Looping result0.00270.14832160.0000
Template Total1.813197.920.9065
Template load0.00220.117920.0011
Template processing1.810797.722220.9053
Template load and register function0.00010.005610.0001
states
state_id_array0.00110.057710.0011
state_identifier_array0.00240.132020.0012
Override
Cache load0.00200.1104830.0000
Sytem overhead
Fetch class attribute can translate value0.00120.065660.0002
Fetch class attribute name0.00190.1028110.0002
XML
Image XML parsing0.00170.089360.0003
class_abstraction
Instantiating content class attribute0.00000.0017140.0000
General
dbfile0.00360.1932340.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
11content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 44
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs