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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:52:56
Script start
Timing: Jan 18 2025 15:52:56
Module start 'layout'
Timing: Jan 18 2025 15:52:56
Module start 'content'
Timing: Jan 18 2025 15:52:56
Module end 'content'
Timing: Jan 18 2025 15:52:56
Script end

Main resources:

Total runtime0.0146 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.4844152.6406
Module start 'layout' 0.00460.0028 742.125039.4766
Module start 'content' 0.00740.0050 781.601697.3672
Module end 'content' 0.01240.0022 878.968842.3047
Script end 0.0145  921.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002516.9226140.0002
Check MTime0.00128.0177140.0001
Mysql Total
Database connection0.00074.683310.0007
Mysqli_queries0.002214.794630.0007
Looping result0.00000.101510.0000
Template Total0.001812.310.0018
Template load0.00096.452810.0009
Template processing0.00095.848710.0009
Override
Cache load0.00074.696310.0007
General
dbfile0.00031.882580.0000
String conversion0.00000.047540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs