Many virtual websites - 1 Gallery source

ffletch2

Joined: 2002-08-16
Posts: 60
Posted: Fri, 2002-08-16 18:44

Has anyone figured out an easy way to have multiple virtual hosts (with multiple galleries) but used only 1 Gallery source?

Thanks in advance for any replies.

PS I like the web forums :smile:

 
drewish

Joined: 2002-08-19
Posts: 16
Posted: Mon, 2002-08-19 20:50

I just drop copies in each directory. It's actually easier that way, each site has it's own independent gallery that they can configure as they like. Gallery seems to be designed with this in mind, ie permissions don't have the concept of of groups you'd want before shareing galleries/albums between sites. And hey, size isn't really a concern, compared to a couple photos from a megapixel camer Gallery's nothing.

 
t7
t7's picture

Joined: 2002-08-31
Posts: 2
Posted: Sat, 2002-08-31 03:51
Quote:
Has anyone figured out an easy way to have multiple virtual hosts (with multiple galleries) but used only 1 Gallery source?

Thanks in advance for any replies.

PS I like the web forums :smile:

One way of doing this is to keep the album directory containg all the photos in a nuetral area. Next create symlinks for each virtual host.

For example:

Lets say you have two nuke sites on the same server

foo.bar.com
and
foo2.bar.com

Each site can be completely sepperate but still share the same album. How?
1. Having each copy of gallery point to the album in the central location.
2. Create a symlink point to the correct gallery.

Either way works.

Symlink example:
ln -s /usr/local/www/albums/ /user/local/www/foo/albums

this will create a "virtual folder" in directory ../foo called "albums" which just links back to ../www/albums

Hope this helps.

-t7

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sat, 2002-08-31 09:09

I think someone made a mod for this, check the updated User Guide
under add-ons. Otherwise do a forum search, I'm pretty sure someone
had a semi-working version around here.

 
Misaki

Joined: 2003-01-16
Posts: 4
Posted: Thu, 2003-01-16 08:00

Hi ppl...
Sorry to dig out this thread~
But i cant find much info on how to do this~

Currently I have 5 galleries, each has their own copies of the php files in 5 different directories~ 5 is ok to do this, but if I'm to have more than 10 galleries, updating the codes or upgrading the galleries will be a big pain~ Is there any way at all to use only ONE copy of codes?

Thanx in advance~ :smile:

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2003-01-16 08:25

Hi. Please read this post. In it, there's a link to *another* post, which has a belaboured solution as well as, at the bottom, a link to a patch from user muggles, which you might want to investigate. You can just ignore all my rants about why not to do this. :wink:

http://gallery.sf.net/forums.php?topic=2942

-Beckett (

)

 
nickh

Joined: 2003-06-20
Posts: 1
Posted: Fri, 2003-06-20 03:31

I made the following small patch to init.php:

http://nickh.hengeveld.com/gallery-vhosts.patch

This allows me to override global configs by setting an environment variable for each vhost that points to a local config file for that vhost, eg in Apache:

SetEnv GALLERY_LOCAL_CONFIG "/home/galleries/nickh.hengeveld.com/config.php"

Each vhost in my environment needs a custom albumDir, photoAlbumURL, albumDirURL, userDir, and generally gets a custom galleryTitle and sessionVar as well.

In addition, I modified config.php such that albumDir, photoAlbumURL, albumDirURL, and userDir are all set to vhost-specific defaults using the server name, eg:

$gallery->app->albumDirURL = "http://" . $_SERVER["SERVER_NAME"] . "/albums";

It's easier to create a gallery for a new vhost as they'll work fine without a local config, and only need galleryTitle and sessionVar defined for cosmetic purposes. However, it's also slightly more of a pain to upgrade gallery since the upgrade process overwrites config.php.

 
hampus

Joined: 2005-05-05
Posts: 4
Posted: Thu, 2005-05-05 19:37

I have been using gallery for a while now and I have created a patch for the feature that you want. To use the same gallery codebase for several virtual hosts but with different config.php files for each.

I wrote a patch for gallery that you may find here:
http://virtualgallery.friendlyfire.net/

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sun, 2005-05-08 23:05

You could also probably accomplish this in linux with symlinks. You could symlink every file in the gallery source with some sort of script (to automate it) leaving off the config.php and .htaccess file to NOT be duplicated. Each site would have its own /albums dir though.