Installing Apache::Gallery

This is a step by step guide for installing Apache::Gallery (libapache-gallery-perl) on Debian, this will possible also work for Ubuntu.

The system i did the installation on was a Debian 7 (Wheezy).

First lets install the basic packages:
first install Apache 2:

aptitude install apache2

Now for perl:

aptitude install libapache2-mod-perl2

now for Image::Imlib2:

aptitude install libimage-imlib2-perl

Finaly install Apache:Gallery:

aptitude install libapache-gallery-perl

now make the apache config for the new gallery site, in my case i addet a virtual host to my apache config:

i choose to use the /var/www/gallery as the place for my photos, feel free to use any other place.

Now for the apache config, this is straight forward, if in trouble look at this link: debian-administration.org

<VirtualHost *:80>
        ServerName   testserver01.some.com
        DocumentRoot /var/www/gallery/  #<----- make sure this directory is readable by www-data
        ErrorLog     /var/log/gallery-error_log
        TransferLog  /var/log/gallery-access_log
        PerlSetVar   GalleryTemplateDir '/usr/share/libapache-gallery-perl/templates/default'
        PerlSetVar   GalleryInfo 'Camera => Model, Picture Taken => DateTimeOriginal, Flash => Flash, ShutterSpeed => ShutterSpe$
        PerlSetVar   GallerySizes '640 1024 1600 2272'
        PerlSetVar   GalleryThumbnailSize '100x75'
        <Location />
            SetHandler  perl-script
            PerlHandler Apache::Gallery
        </Location>
</VirtualHost>

restart apache with:

/etc/init.d/apache2 restart

Apache:gallery will properly generate a error looking something like this (look at /var/log/gallery-error_log):

unable to writhe to /var/cache/www/testserver01.some.com

make the directory and make sure www-data have writing access.

Now for the gallery.css file.
Place gallery.css in the gallery root directory (in this example /var/www/gallery)

use this code for the css style:

body {
    background-color: #cccccc;
    font-family: Verdana, Lucida, Arial;
    font-size: 10px;
    margin-left: 10px;
    margin-top: 10px;
    text-align: center;
}
td {
    font-size: 10px;
}
table {
    margin-left: auto;
    margin-right: auto;
}
#menu {
    font-size: 11px;
    text-align: left;
    height: 30px;
}
#nav {
    font-size: 11px;
    text-align: left;
    height: 30px;
    text-align: right;
}
#directory {
    background-color: #ffffff;
    border: 1px solid #666666;
    padding: 20px;
    text-align: left;
    top: 0px;
}
#folder {
    float: left;
    height: 100px;
    padding: 2px;
    text-align: center;
    width: 120px;
}
#picture img {
    border: 1px solid #000000;
}
a {
    color: #5555aa;
}
a img {
    border: 2px solid #5555aa;
}
a:hover {
    color: #ff9400;
}
a:hover img {
    border: 2px solid #ff9400;
}
#folder img {
    border: 0px;
}
.info {
    background-color: #eeeeee;
    border: 1px dashed #888888;
    color: #666666;
    font-size: 10px;
    margin: 10px;
    padding: 5px;
}

make the following directory /usr/share/apache2/icons/gallery and copy the icons from /usr/share/libapache-gallery-perl/icons to the new directory

restart Apache.

there you have it there should be a working gallery now 🙂

remember to add some photos to the new gallery

more info can be found at http://apachegallery.dk/