Installing a Weblery Photo Gallery on a Pogoplug

My Weblery gallery

This how-to assumes that you are running Debian on your pogoplug/dockstar and have already have lighttpd installed. In addition it assumes you have either Webdav or Samba on your pogoplug/dockstar so that you can move files to your gallery folder from your desktop or laptop. The gallery uses a simple PHP based photo gallery program called Weblery.

Start by making PHP5 work in Lighttpd through FastCGI-enabled PHP5 package which we install like this:

    apt-get install php5-cgi php5-gd

To enable PHP5 in Lighttpd, we must modify /etc/php5/cgi/php.ini and add the line cgi.fix_pathinfo = 1 right at the end of the file:

    nano /etc/php5/cgi/php.ini

and add

    cgi.fix_pathinfo = 1

At this point you need to decide where you are going to put your photos and setup a folder to hold your galleries. I put mine on separate, larger usb flash drive as follows:

    cd /the-place-you-are-putting-yourfiles/

Install Weblery using:

next

    cd /var/www/
    ln -s /the-place-you-are-putting-yourfiles/your-gallery-directory / /your-gallery-directory/

Now configure lighttpd to gain access your gallery:

    cd /etc/lighttpd
    nano lighttpd.conf

Then scroll down to the bottom of the file and add:

    $HTTP["host"] == “your-gallery-directory.your-domain-name.com” {
    server.document-root = “/var/www/your-gallery-directory”
    alias.url = ( “/your-gallery-directory” => “/var/www/your-gallery-directory” )
    }

One limitation of Weblery is that it doesn’t orient photos. This should be done before opening your gallery folder the first time. You can accomplish this with one of the command line programs that comes with Imagemagick. Unfortunately, this takes a very long time on a pogoplug.

Instead, I installed imagmagick on my Ubuntu desktop so that I could orient the photos before I moved them to the pogoplug server.

To do this:

    sudo apt-get install imagemagick

Next open a console and navigate to the folder containing your photos and orient your photos:

    cd /your-desktop-folder-name/
    mogrify -auto-orient *.jpg

Finally use either Samba or rsync to move folders containing your now-oriented photos from your desktop to /your-gallery-directory/albums. Samba is easier, but carries a bit more risk because you have to have samba on your web server and samba would potentially give a hacker easy access to your other computers.

I’m using rsync. To install rsync on your web server use:

apt-get install rsync

Then create a directory in your home folder

mkdir ~/albums

next copy the director you wish to move to your gallery into ~/albums

then you can move folders from your desktop to your gallery using something like:

rsync -rvzut -C -e ssh ~/albums/ –rsync-path=/usr/bin/rsync root@192.168.1.77:/your-gallery-directory/gallery/weblery/albums/

These transferred folders will show up as photo albums when you open up your gallery with your browser. Note: the first time you open a given folder form a browser, Weblery does some processing. This can take a while if you have more than a handful of photos to process.

If, you call up your photo gallery and instead of your photos, you see a directory listing then open a terminal and:

    cd /etc/lighttpd
    nano lighttpd.conf

and add weblery.php to the list of index-file.names. The result should look something like this:

    index-file.names = ( “index.php”, “index.html”,
    “index.htm”, “default.htm”,
    “index.lighttpd.html”,”weblery.php”)

Then save the file and run

    /etc/init.d/lighttpd restart

A final word: I expect that this would work on a Pogoplug/Dockstar running Optware as well with some modifications to the Install Procedure, the reason I chose Debian for this install was because I wanted a firewall on the machine. I had some concerns around locking myself out of ssh access putting a firewall on Pptware and I knew I could make Ipkungfu work like I wanted.

  1. Installing a Weblery Photo Gallery on a Pogoplug Ubuntu&Pogoplug howtos is a superb share. Thank you for this article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: