Uploading files to multi-site configuration

Author Message

Jan Eirik Forland

Wednesday 06 April 2011 1:58:21 am

Hi,

I've just recently started developing in eZPublish, and I have now set up a multi-site configuration for a project I'm working on. In my site.ini.append.php file I have set up both URL and Host mapping. That is, I have set up the site as such:

MatchOrder=uri;host

URIMatchType=map

HostMatchType=map

URIMatchMapItems[]=admin;admin_site

HostMatchMapItems[]=www.site1.com;site1

HostMatchMapItems[]=www.site2.com;site2

My goal with this setting is to have a unified admin interface for both sites. That is, I can access the admin interface by typing the URL www.site1.com/index.php/admin or www.site2.com/index.php/admin. This works like a charm! :)

The problem arises when I upload a file to the Media section when in the admin interface. The file then gets stored at the /var/admin/storage/original... folder. This means that when a user is presented with the option to download a file that has been uploaded in the admin interface, they first have to log on to the admin interface!! WE DO NOT WANT TO DO THAT!

Any ideas?

André R.

Wednesday 06 April 2011 2:38:06 am

Possible mistakes:
Are you using different var dir's for the different siteaccesses? (when siteaccesses share content they should use same var folder)
Or is there something wrong with the virtualhost matching rules maybe, so that Apache does not handle the var/admin path correctly.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jan Eirik Forland

Thursday 07 April 2011 4:19:52 am

Yes, I'm using different var dir's for the different siteaccesses. But that's because the sites don't share content.

I've checked the virtualhost matching rules, and they are correct. I found a solution that I can live with. The problem was that uploaded files to the Media Library was stored in the var/storage directory under the var/admin folder. This meant that you had to access the admin siteaccess to download the files (when used as links in articles etc). In the site.ini.append.php file in the admin siteaccess, i just added the following line:

[SiteAccessSettings]

AnonymousAccessList[]=content/download

This solved my problem perfectly. The files are still stored under admin's var directory, but that I can live with :)

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 00:52:59
Script start
Timing: Jan 18 2025 00:52:59
Module start 'layout'
Timing: Jan 18 2025 00:52:59
Module start 'content'
Timing: Jan 18 2025 00:53:00
Module end 'content'
Timing: Jan 18 2025 00:53:00
Script end

Main resources:

Total runtime0.6683 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.0469152.6406
Module start 'layout' 0.00560.0029 740.687539.4844
Module start 'content' 0.00850.6587 780.1719542.2500
Module end 'content' 0.66710.0011 1,322.421912.1250
Script end 0.6683  1,334.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4750160.0002
Check MTime0.00140.2045160.0001
Mysql Total
Database connection0.00080.118910.0008
Mysqli_queries0.622893.1838570.0109
Looping result0.00040.0583550.0000
Template Total0.643296.220.3216
Template load0.00220.329820.0011
Template processing0.641095.907920.3205
Template load and register function0.00020.023610.0002
states
state_id_array0.00070.108510.0007
state_identifier_array0.00070.101520.0003
Override
Cache load0.00190.2807310.0001
Sytem overhead
Fetch class attribute can translate value0.00050.075720.0003
Fetch class attribute name0.00100.147540.0002
XML
Image XML parsing0.00060.091420.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00070.1080170.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs