views:

40

answers:

1

I have set up 2 drupal instances pointing 2 codebase with a common database

  1. www.abc.com points to folder /var/www/abcfolder
  2. mywww.abc.com points to folder /var/www/mywwwabcfolder

The content is uploaded via mywww.abc.com and www.abc.com is used for general viewing. I have used domain access module where mywww.abc.com is an alais to mywww.abc.com

I want that all the files that are uploaded should be maintained in a common folder i.e. in /var/abcfolder/public/sites/all/files for both urls

I tried changing the file system path via admin/file-system to ../../abcfolder/public/sites/default/files since the path should be relative to the drupal installation folder. However on uploading a file, I get a file not found error.

Any help to resolve this issue would be appreciated?

Should I change the htaccess file in any one of the codebase? If yes, what should the change be?

Regards, Loveleen

+1  A: 

How about trying this:

Store the files in /var/www/abcfolder/sites/default/files. Create a symbolic link from /var/www/mywwwabcfolder/sites/default/files to /var/www/abcfolder/sites/default/files

Look up symbolic links in linux if you don't know what they are. If you're using windows you can still do symbolic links but they are more complicated.

[BTW I am not sure why you are doing this complicated setup. Reconsider using domain access unless you really need to. Is it necessary to have two sites like this? ]

Sid NoParrots
Hi @NoParrots,This setup is used for a multisite magazine where there are multiple magazine sites using the same codebase and database using domain access module. Now in order to make these faster, it was advised to use a CDN. However several session related issues arise due to the use of domain access module on CDN. Hence it was thought that 2 instances of the codebase be maintained so that while one instance(mywww.abc.com) can be used for adding content and the other(www.abc.com ) for public viewing.
Loveleen Kaur
The idea behind using 2 instances is that while one instance(www.abc.com ) can be migrated to CDN (which causes a problem in session due to domain access module), the other instance(mywww.abc.com) can be kept off the CDN and hence the session problem for editors remains out of scope. Also, the cache time for the instance for public viewing can be increased so that load on web server is reduced.
Loveleen Kaur
There is problem with your solution. Creating symbolic links is a manual process but content shall be added on an ongoing basis. Also since the database is common, upload of any file shall cause the files to be stored in their respective folders.
Loveleen Kaur
@Lovleen: You need to create a symbolic link between the directories only once.
Sid NoParrots
@Lovleen: Please note it is a symbolic link from one of "files" directory to another. It is not a symbolic link between individual files.
Sid NoParrots
Thankees @NoParrots
Loveleen Kaur