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.