INSTALLATION INSTRUCTIONS FOR NERDS

 

 

Preparation

First, read the Introduction, that contains some important information I don't want to repeat once more.

If you don't want to run the install script, there is an easy way to install the software manually. You have to complete two tasks:

  1. Install the new PO version.
  2. Create or migrate the image repository.

 

Install or Upgrade Photo Organizer

Follow these step by step instructions to install or upgrade the software:
  1. Create a postgresql user and postgresql database. You will need to have access to a postgresql user account that is allowed to create new users. In case you are upgrading skip this step and use the exisiting database and database user. We will refer to the database as po_database and to the database user as po_user in the future.
  2. [balint@apollo ~]$ createuser -U pg_superuser po_user
    Shall the new user be allowed to create databases? (y/n) y
    Shall the new user be allowed to create more new users? (y/n) n
    CREATE USER
    [balint@apollo ~]$ createdb -U po_user po_database
    CREATE DATABASE

  3. As the superuser of your database server, add the plpgsql language to your newly created database.
  4. [balint@apollo ~]$ createlang -U pg_superuser plpgsql po_database

  5. Untar the distribution po.2.18.tar.gz. Change directory into po.2.18 (the directory created upon untar). Actually if you can read this file you already completed this step. Anyway, all directories in this document are relative to this one, except when indicated otherwise.

    [balint@apollo ~]$ tar xvzf po.2.18.tar.gz
    [balint@apollo ~]$ cd po.2.18
    [balint@apollo po.2.18]$ ls
    doc install mkconfig src

  6. Go into the src/sql directory where you will find the sql files:

    [balint@apollo po.2.18]$ cd src/sql
    [balint@apollo sql]$ ls
    photo.organizer.data.2.5.C.sql
    photo.organizer.db.2.5.C.sql
    ...
    photo.organizer.data.2.17.C.patch.2.18.C.sql
    photo.organizer.db.2.17.C.patch.2.18.C.sql

  7. Log into the po_database as po_user.

    [balint@apollo sql]$ psql -U po_user po_database
    Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
    photo=#

    1. If your database is not older than 2.5 you can upgrade it by applying the apropriate patch files. Say you have a 2.15 database, you can upgrade it to 2.18 by applying the following files (order does matter):

      photo=# begin;
      BEGIN
      photo=# \i photo.organizer.db.2.15.C.patch.2.16.C.sql
      photo=# \i photo.organizer.data.2.15.C.patch.2.16.C.sql
      photo=# \i photo.organizer.db.2.17.C.patch.2.18.C.sql
      photo=# \i photo.organizer.data.2.17.C.patch.2.18.C.sql
      photo=# commit;
      COMMIT
      photo=# \q
      [balint@apollo sql]$

      Just like in this example, make sure to start a transaction before loading the files - should anything go wrong you have a chance to restore the database with a rollback command

    2. If you have just created an empty database, load the files in the following order (order does matter):

      photo=# \i photo.organizer.db.2.5.C.sql
      photo=# \i photo.organizer.data.2.5.C.sql
      photo=# \i photo.organizer.db.2.5.C.patch.2.6.C.sql
      photo=# \i photo.organizer.data.2.5.C.patch.2.6.C.sql
      ...
      photo=# \i photo.organizer.db.2.17.C.patch.2.18.C.sql
      photo=# \i photo.organizer.data.2.17.C.patch.2.18.C.sql
      photo=# \q
      [balint@apollo sql]$

  8. Go to the src directory where you will find the php files. If you are upgrading merge your exisiting configuration file into src/include/config.php.

    If you are installing a new system the src/include/config.php file and fill in the database connection information. You have to change the the $image_repository_path variable to point to your image repository. By default the system uses the /tmp directory to store temporary files. You can specify a different directory by overloading the $tmp_volume_path variable.

    1. If you have a previous PO installation, remove the old php files.

      [balint@apollo sql]$ cd ..
      [balint@apollo src]$ rm -rf /var/www/html/po/*

    2. Copy the whole src subtree into a location of your choice whitin the HTTP server's document_root directory, or into the location of the old php files.

      [balint@apollo src]$ cp -R * /var/www/html/po

  9. Log in as root and change the ownership of the installation (of the php files and directories) to the user which runs the HTTP server. Make sure that the index.php file is not only owned by the user that runs the HTTP server but also has write permissions, so that you can edit your Front Page template online.

    [balint@balint tmp]$ su
    Password:
    [root@apollo src]$ chown -R apache:apache /var/www/html/po
    [root@apollo src]$ chmod +w /var/www/html/po/index.php

 

Create the Photo Organizer Image Repository

  1. Log in as root and create a directory anywere on the server (not located or linked in the HTTP server's document root directory), we will reference this directory as your image repository

    [root@apollo export]$ pwd
    /export
    [root@apollo export]$ mkdir my.repository

  2. Create a volume (preferably v0000) in this directory. Afterward create sub-volumes - they must be named as 00000, 00001, and 00002. If you already have a 2.13 system read the Migration section for more details.

    [root@apollo export]$ mkdir my.repository/v0000
    [root@apollo export]$ mkdir my.repository/v0000/00000
    [root@apollo export]$ mkdir my.repository/v0000/00001
    [root@apollo export]$ mkdir my.repository/v0000/00002

  3. Check for the include/config.php file in your PO installation directory, and edit the variables $image_repository_path to point to your image repository, than in the Photo Organizer administrator interface, select the current volume.

  4. Change the ownership of the repository recusrively to the user which runs the HTTP server (apache in our case), and make sure that the user can read and write the repository.

    [root@apollo export]$ chown -R apache:apache my.repository
    [root@apollo export]$ chmod -R 750 my.repository

  5. Finally, log into Photo Organizer's administrator account and visit the Admin tab. In the Image Repository section you should see your first volume v0000, which you have to set as the current volume. If the Image Repository view displays no volumes that means that the $image_repository_path was not set up properly.

Comments and corrections are welcome at balint@k-i-s.net.