I have already installed and configured Gallery and all went ok. The main problem I have is that my webspace and php are on 2 different servers and the php server only has 50mb limit.
Is there a way of pointing the uploading the pictures to albums that are on other servers.?
I have already tried setting the path to ftp://user:pass@ftp.site.com/album but the gallery config can't find it.
Help!!
Posts: 7994
Gallery doesn't have that functionality right now. It's something that we may attempt to do in the future, though.
Posts: 3
ok, I look forward to that :smile:
In the meantime, I've tried to find some documentation regarding Mirroring the albums. I presume, to get round my current problem I could upload pictures to the current directory then move the album to another server and delete the album on the original server ??
What I don't want to do is run out of webspace... will be a pain in the arse :smile:
Posts: 7994
Here's a blurb on mirroring that I wrote a long time ago:
The mirroring code is for the case where you have your Gallery on
a slow server (like, on a DSL line) but you have storage on a fast
server somewhere out on the net. You must manually copy your albums
directory out to the fast server and keep it up to date, then you
can tell Gallery the URL of the mirrored albums directory and it
will draw images from there if possible. You must keep
a copy of the original files on your server with Gallery. You
can't use mirroring to free up space on your webserver.
To illustrate, I've got my Gallery running on my box at home behind
my DSL line. A very kind Gallery user has given me a lot of disk
space on a very fast box where I keep a mirror copy of my albums
directory. I use rsync to keep the remote site up to date.
The mirror site can be a mirror of any or all albums. Each album
must be complete, but you don't have to mirror all of them. You
can just selectively mirror the ones that you use the most (but
it's up to you to write a script to manage that).
You *only* need to update your mirror when your serial.#.dat file
changes. The serial file is there to track when a change actually
affects the mirror. Typically, this is only a change that affects
an image (anything that changes a source, sized or thumbnail image,
deleting or adding new images).
Text changes should not cause you to have to re-sync, but experiment
and watch the serial.#.dat file to see for yourself.
Posts: 2
How do you deal with Comments being added on the remote server being overwritten when you make a caption/description/album modification locally and then rsync your files?
Posts: 7994
Ah, it sounds like you are setting up two Galleries. That won't work.
The remote server doesn't have a gallery. It only has your albums. The Gallery (on your local server) will properly create URLs to draw images from the remote server. The remote server is simply a mirror of your images.
Posts: 101
ive setup mirroring between two galleries ... however , one overwrites the other, so comments and hit counters are overwrritten (im sure that could be over-ridden too, but havent looked into it).
there are several "site specific" things that need not be mirrored, so in some dodgy scripting ive done the following. ;
on gallery.darb.net (the master, hosted here in perth), I run a script that does the following ;
#!/bin/sh
echo "Beginning mirror process"
echo "Moving temporary gallery directory into place"
mv /storage/gallery /storage/gallery.hold
mv /storage/gallery.closed /storage/gallery
echo "Moving location specific files and logs out of gallery"
mv /storage/gallery.hold/.users /storage/
mv /storage/gallery.hold/originals /storage/
mv /storage/gallery.hold/access_log /storage/
mv /storage/gallery.hold/html_wrap /storage/
mv /storage/gallery.hold/albums.php /storage/
mv /storage/gallery.hold/config.php /storage/
cd /storage
echo "Now creating the tarball in /home/httpd/html/mirror/gallery-mirror.tar"
tar -zcf /home/httpd/html/mirror/gallery-mirror.tar.gz gallery.hold/
echo "Now moving location specific files and logs back into the Gallery"
mv /storage/access_log /storage/gallery.hold/
mv /storage/originals /storage/gallery.hold/
mv /storage/albums.php /storage/gallery.hold/
mv /storage/html_wrap /storage/gallery.hold/
mv /storage/.users /storage/gallery.hold/
mv /storage/config.php /storage/gallery.hold/
echo "Reinstating the Gallery to the Live Gallery directory."
mv /storage/gallery /storage/gallery.closed
mv /storage/gallery.hold /storage/gallery
echo "Restarting Apache to re-initialise logs"
/etc/rc.d/init.d/httpd restart
echo "Done"
that pretty much moves all site specific stuff out, then tarballs the gallery (my html_wrap and a few other hacks that are site spefic, as youll see on the site).
On the other site, http://usa.darb.net/ i run the other dodgy script that does this ...
#!/bin/sh
cd /home/bpd/website/
echo "Getting updated Tarball from http://www.darb.net/mirror/gallery-mirror.tar.gz"
wget -NS http://www.darb.net/mirror/gallery-mirror.tar.gz
echo "Extracting Tarball to gallery.hold"
tar -zxf gallery-mirror.tar.gz
echo "Moving current gallery to gallery.old"
mv /home/bpd/website/gallery /home/bpd/website/gallery.old
echo "moving Gallery.hold new mirror to gallery.new"
mv /home/bpd/website/gallery.hold /home/bpd/website/gallery.new
echo "Migrating location specific files back to the new gallery.new"
mv /home/bpd/website/gallery.old/.users /home/bpd/website/gallery.new
mv /home/bpd/website/gallery.old/html_wrap /home/bpd/website/gallery.new
mv /home/bpd/website/gallery.old/albums.php /home/bpd/website/gallery.new
mv /home/bpd/website/gallery.old/config.php /home/bpd/website/gallery.new
echo "moving the freshly mirrored Gallery to the live directory"
mv /home/bpd/website/gallery.new /home/bpd/website/gallery
echo "Giving ownership of live directory to nobody.bpd"
chown -R nobody.bpd gallery/
echo "restarting apache to re-init logs"
/usr/local/orsmapache/bin/apachectl restart
echo "deleting Old Gallery Directory"
rm -rf gallery.old
echo "done"
that pretty much does the same thing ... moves site specific stuff out, grabs a copy from the tarball in perth (usa.darb.net is hosted in idaho) ...extracts it, then moves the site specific stuff back, restarts apache and voila ... the wget -NS command checks for a newer version of the tarball/gizball and wont grab it unless its newer (saves the 600mb of pics if no update needed). You could easily automate it using cron or some scheduler, but i leave mine manual and update when i feel.
hope that helps some.
Posts: 7994
Holy chamunga. That's complicated! The only thing you need to mirror is the albums
directory. I have a cron job on my master server that syncs the albums to my mirror server
and it looks like this:
/usr/local/bin/rsync --times --recursive --delete --stats --update --compress --checksum --bwlimit=2 --verbose --exclude .users/ /path/to/master/albums
:/path/to/albums
That does a 2kbyte/second synchronization of the files from my master to mirror server.
I limit the bandwidth so that it trickles the data out in the background (in case I'm using the server for other purposes), and it doesn't sync the .users directory for security reasons.
Rsync is an awesome tool. Try it out.
Posts: 101
bharat : can i also exclude the likes of html_wrap, access_log, etc ... does the rysync have to run on both boxes as a service of some sort?
Posts: 7994
Yes. You only need the albums directory.
Nope. You just need to have it installed on both boxes and be able to SSH between the two of them.
Posts: 86
Bharat,
Any chance you can teach us how to install your rsync script as a daily cronjob?
Moreover I am actually running three galleries on the same server (to serve different member groups). So there are three independent albums. Do I run the cronjob three times (with respective path modifications), or there is a way to consolidate all action in one shot?
Thanks,
Chow
Posts: 7994
You can create one script that runs 3 consecutive rsync jobs, each which syncs a different local albums directory to a remote one. ie,
foo.sh contains:
#!/bin/sh
rsync ... /albums1 remote:/albums1
rsync ... /albums2 remote:/albums2
rsync ... /albums3 remote:/albums3
As for creating a cron job, that varies from system to system. Your best bet is to ask your local system administrator about the local policies and methodology. On my machines, I can run "cron -e" to edit my personal crontab job listing and then add jobs (run "man crontab" for help on how to use the crontab command).
Posts: 86
Need one more trick. The remote site will ask for my username and password. How do I include them on my rsyncalbums.sh :roll:
I have only one remote site :smile:
Posts: 7994
I use ssh as the transport medium for rsync. Ssh allows you to create a private key/public key combo pair to allow you to log in directly to the remote box without entering a password. There are a ton of walkthroughs for this on the web -- the almighty Google will tell all!