Page 1 of 1

Shared media library across multiple s9y sites?

Posted: Sat May 03, 2008 1:20 am
by Don Chambers
I have 3 s9y installations. Each is its own domain, database, etc. They do, however, exist on the same physical server. Is there a way to configure s9y so that all 3 share the same media library?

Posted: Sat May 03, 2008 6:53 am
by abdussamad
You could try something like the s9y shared installation:

http://s9y.org/41.html

If you want a simpler conversion of your current setup with then you could try to just share the uploads directory. Say the three installations are currently in /home/ex1, /home/ex2 and /home/ex3 and you want to all three to share /home/ex1/uploads you could chmod 777 /home/ex1/uploads and then symlink from the other directories:

ln -s -d /home/ex1/uploads /home/ex2/uploads
ln -s -d /home/ex1/uploads /home/ex3/uploads

Then you would probably also want to do a rebuild thumbs in each of the admin panels.

Posted: Sat May 03, 2008 7:22 am
by Don Chambers
Thanks for the reply Abdussamad - I'm not at all familar with soft/symbolic links.

I tried to set each of the sites up to the same absolute upload path, but that did not work.

Posted: Sat May 03, 2008 3:17 pm
by garvinhicking
Hi!

Yes, this is only possible through symbolic links. That's the most convenient and best-working way to do it, symlinks rock.

Regards,
Garvin

Posted: Sat May 03, 2008 3:46 pm
by Don Chambers
OK, then how exactly do I set up these symlinks? I do not understand this part:

Code: Select all

ln -s -d /home/ex1/uploads /home/ex2/uploads
ln -s -d /home/ex1/uploads /home/ex3/uploads
Is this command entered once, then exists until changed? Entered each time the server starts? How is it turned off in the event it is no longer wanted?

Posted: Sun May 04, 2008 12:41 pm
by garvinhicking
Hi!

This is a shell/unix/bash command that you need to type via SSH or usingaPHP script. Once created it's like a file, and you don't need the command any more.

Removing it is like deleting a file.

Regards,
Garvin

Posted: Sun May 04, 2008 4:20 pm
by Don Chambers
Thanks again Garvin & Abdussamad - question regarding the rebuilding of thumbs. If each of these separate installations is looking at the same media library via the symlink, why does each one need a separate rebuild thumbs? Wouldn't rebuilding for one rebuild for all?

Also, the reason I want to do this is so that media can be placed in this common/shared location WITHOUT using the "add media" admin link (ie, perhaps ftp the files to the server). Will each installation see all the media files provided "Enable on-the-fly media synchronization" is enabled?

Posted: Sun May 04, 2008 9:18 pm
by garvinhicking
Hi!

The media is "cached" inside serendipity_images table. Each s9y installation needs to keep this table in synch with the filebase. You can either do that manually through rebuilding thumbnails, or you can enable the auto-synch of s9y inside the s9y configuration. (which should answer your second question)

So it's not really about thumbnails, but synchronizing the DB.

Posted: Mon May 05, 2008 1:48 am
by Don Chambers
Thanks Garvin - I've noticed the sync does not really work the way I would expect it to.... I have not tried this symlink yet, but I have noticed before if I ftp files to my upload folder, then try to insert an image into an entry or extended property field, the newly added files are not shown. If I click on the media library link first after adding files, then try to add one to an entry later, it does sync. Is there a way to get this to be truly sync'd so that interim "check" of the media library is not necessary?

Posted: Mon May 05, 2008 10:01 am
by garvinhicking
Hi!

You should be able to circumvent this by enabling your personal config option to show the Maintenance Options of the MDB also inside the popup. Once those (delete, rotate, ...) are displayed, the sync should also be executed?

HTH,
Garvin

Posted: Mon May 05, 2008 3:34 pm
by Don Chambers
That does seem to do the trick. I often forget to turn that on. Any chance of getting that option on the initial configuration page so it can default to true for all users if so selected (like "Comments & trackbacks to this entry requires moderation" & "Allow comments to this entry")?

Posted: Mon May 05, 2008 3:40 pm
by garvinhicking
Hi!

That is a different page alltogether and not so easy to accomplish, because the seperation of per-user settings and "global" settings do not allow so easy to just tell "hey, that's an option that can be made globally".

The whole system should be reworked at that place, because also the defaults when creating new users should depend on this global configuration.

Regards,
Garvin

Posted: Mon May 05, 2008 4:00 pm
by Don Chambers
Guess I mistook those initial configuration settings (which apply to the admin user) as global. Yes, defaults for all users would be nice.