Previous
Overview
Top Next
Collecting and Managing Photos

Installing the Photo Album Manager

Update: Since it makes sense to dedicate a computer—real or virtual—for this purpose, I've developed an installer to make this as easy as possible. Have a look at my Easy Foto Box project. No system administration skills required! So feel free to skip this page.

Upgrades

Note!
Always be sure to check the Release Notes before upgrading your code or database. And, of course, always back up everything.

If you're upgrading from a previous version, you'll need to add some tables and records to your database to support the new features. The easiest way (after dumping and backing up your database!) is to run this script:

sh scripts/local/updateschema.sh foto

This will enable new tools and create new tables to support them. If this has already been done, running the script will do no harm, but it may generate some error messages complaining that relations and indices already exist; you can ignore these messages.

If you prefer, you can simply examine the script and carry out the steps manually.

As the system administrator, root:

  1. Configure the host server, including Apache2, PHP, PostgreSQL and ImageMagick. While system administration issues are beyond the scope of this document, I can offer some tips:
    • While the Photo Album Manager should run on your favorite distribution, I recommend Debian GNU/Linux (stable), especially if you're dedicating a box to this service. This has the advantage of being almost trivially easy to update without breaking your scripts, since Debian stable installs only fixes and security patches and never upgrades to a functionally different version of a package.
    • I generally configure Apache2 to support both plain http and ssl (https). However, the non-ssl web tree contains only redirector pages that switch to the ssl web tree.
    • I make a separate /home partition that contains my dumped PostgreSQL databases as well as my web trees, so I can update or replace the operating system with no damage to my data.
    • Since I build such servers often, I've assembled a "standard" set of configuration files and scripts, my Debian HostConfig Kit (see Resources) to make it easy to set up a new box. Unless you're planning to run other services on the box, you can omit most of the application packages. If you're not planning to use this as the client, you can omit the desktop environment. If you do want the desktop, you might prefer my Kubuntu HostConfig Kit (see Resources).
  2. Identify the web-server user account; typically it's "www-data" or "apache".
  3. Ensure that PostgreSQL allows you (the regular user who will run the setup script) and the web server user to access postgreSQL databases from the local host. I do this in /etc/postgresql/.../pg_hba.conf (in my case, it's /etc/postgresql/7.4/main/pg_hba.conf) with these lines:
    # Allow anything over localhost
    local all all trust
    host all all 127.0.0.1 255.0.0.0 trust
    host all all 0.0.0.0 0.0.0.0 reject
  4. Reserve the web server's document root, or a subdirectory therein, for the Photo Album Manager php code and data, with permissions allowing you (the regular user running the setup script) to write files into it. I'll refer to this directory as the service root from now on.
  5. Create three subdirectories: originals, webpics, and albums under the Photo Album Manager's service root. They should be owned by the web server user (and the group of the same name) with permissions 2755 (rwxr-sr-x), for example:

    drwxr-sr-x 2 www-data www-data 4096 Nov 24 20:07 albums/

As a non-root user:

  1. Unpack the entire package in a safe place (not the web server document tree).
  2. Edit the system configuration file scripts/local/ldef_common.sh to define your system:
    WebServerUser Userid under which web server runs (typically "www-data" or "apache")
    WebServerDocumentRoot Same as in /etc/apache-ssl/httpd.conf
    ServiceRoot Root for production service, relative to document root (default "/foto/" but if it's the only service running on the web server, you might make it "/")
    DumpDir Where you want database dumps to go (default /home/dumps)
    OriginalPhotos Folder from which to fetch originals (default /home/public/photos) where they're originally uploaded from the camera memory

  3. Edit the web service configuration file web/local/ldef_env.php:
    $ServiceRoot same as ServiceRoot in scripts/local/ldef_common.sh above
    DefaultDbUser same as WebServerUser in scripts/local/ldef_common.sh above
    Colors ...if my defaults aren't to your taste
    Photo Album Manager-specific settings at the end of the file as explained in the comments. Don't change OriginalPhotos, since it's a symlink that the setup script will create automatically.

    Tip: Leave the original settings until you are sufficiently familiar with the Photo Album Manager.


  4. Run sh scripts/setup.sh -h

    The -h option displays a help screen and checks whether basic system requirements have been met. Once it looks ok:

  5. Run sh scripts/setup.sh

    This will check preconditions, create a production database, and set up the PHP code in the service root.

Using a web browser:

  1. Connect to the service, generally https://hostname/serviceroot/
  2. Log in as admin, password "I'm the BOFH" and change the password when prompted.
  3. From the main menu, click "Manage User Accounts" and add a new user.
  4. Return to the main menu, click "Grant Privileges to Users" and select the new user you have just created by specifying name or ID in the search box.
  5. Assign appropriate privileges. I recommend "edit" and "walbum" for regular users, reserving the admin privileges for the admin account to avoid cluttering up everyone's menu.
Previous
Overview
Top Next
Collecting and Managing Photos