20080528 apachegallery on centos 5 - plembo/onemoretech GitHub Wiki

title: Apache::Gallery on CentOS 5 link: https://onemoretech.wordpress.com/2008/05/28/apachegallery-on-centos-5/ author: lembobro description: post_id: 521 created: 2008/05/28 18:12:39 created_gmt: 2008/05/28 18:12:39 comment_status: open post_name: apachegallery-on-centos-5 status: publish post_type: post

Apache::Gallery on CentOS 5

Apache::Gallery creates an thumbnail index of each directory and allows viewing pictures in different resolutions. Pictures are resized on the fly and cached. The gallery can be configured and customized in many ways and a custom copyright image can be added to all the images without modifying the original.

Here are my notes from installing Apache::Gallery on CentOS 5. Latest source is available here.

Prereqs

RPMS from rpmforge.repo:

mod_perl
imlib2
imlib2-devel

(which also loads libid3tag)

perl-Image-Info, which will also load:

perl-Image-Base
perl-Image-Xpm
perl-Image-Xbm

(on my latest install in Sept. 2009 the rpmforge Image::Info package had dependency check problems: in the end I installed it and a couple of prereqs, including XML::LibXML, from source using CPAN)

Then:

perl-Image-Size
perl-Image-Imlib2
perl-Text-Template

Building

export MOD_PERL_API_VERSION=2

perl -MCPAN -e "install Apache::Gallery"

Configuring

1. Copy the template directory from the distribution (it will be under your .cpan/build/Apache-Gallery-1.0RC3 directory) to someplace it can be read by the web server — like the physical DocumentRoot, e.g. /var/www/html/apache-gallery.

2. Copy the special icons from the htdocs directory in the distribution to your web server icons folder, e.g. /var/www/icons.

3. Modify httpd.conf. While most of the configuration can be pushed down into an .htaccess file at the root of your image directory, certain items must be set up inside httpd.conf itself. This is required. There is no way around this.

Here’s a sample of how mine is configured (under the root VirtualHost):

`

Alias /pictures "/export/share/pictures"
<Directory /export/share/pictures>
    AllowOverride All
 </Directory>

`

4. Set the an .htaccess file in place for the directory in question that looks like the following:

`

SetHandler           modperl
PerlResponseHandler  Apache::Gallery
PerlOptions          +GlobalRequest
PerlSetVar           GalleryTemplateDir '/var/www/html/
 apache-gallery/templates/default'

`

(that last directive should all be on one line, thus the “”)

5. Restart Apache to make httpd.conf changes effective.

6. Copy gallery.css from the templates directory to the root of the images directory, and then edit the layout.tpl file so that the href for the stylesheet points to the alias for the images, e.g.:

<link rel="stylesheet" href="/pictures/gallery.css">

Alas, you’ll be hard pressed to find a shared hosting arrangement that allows running this kind of module — mostly because of potential resource issues (your image cache can get quite large, and mod_perl apps are not known for their efficiency). A shame really, because this is a lot more straightforward than most of the other album applications I’ve deployed. But nonetheless this is a terrific tool for viewing pictures stored up on the home server.

Copyright 2004-2019 Phil Lembo

⚠️ **GitHub.com Fallback** ⚠️