All text is available under the terms of the GNU Free Documentation License. For the latest version of this document, see Wikibooks.

Zoph/Installation

Contents

Requirements

First, make sure you meet all the requirements in the previous chapter.

Creating the database

Create a database and import the tables

$ mysqladmin -u root -p create zoph
$ mysql -u root -p zoph < sql/zoph.sql

Create users for zoph

I created two users: zoph_rw is used by the application and zoph_admin is used when I work directly in mysql so I don't have to use root.

$ mysql -u root -p
mysql> grant select, insert, update, delete on zoph.* to zoph_rw@localhost identified by 'PASSWORD';
mysql> grant all on zoph.* to zoph_admin identified by 'PASSWORD';

Configure the PHP templates

Please see the chapter on configuration for details.

Install the templates

Pick a location to put Zoph

Create a zoph/ directory off the doc root of your web server, or create a Virtual Host with a new doc root.

$ mkdir /var/www/html/zoph

Copy the templates

$ cp -r php/* /var/www/html/zoph/

Set accessrights

For better security, you probably want to set accessrights on your Zoph files. (You may want to do this after testing whether Zoph works, in that case you know what caused it when it seizes working after this change)

First, you need to figure out which user Apache is running under. Usually this is apache for both user and group. To determine this, check httpd.conf or use

ps -ef | grep httpd

You should probably make all files owned by the user apache and the group apache. You can do than with

chown -R apache:apache /var/www/html/zoph 


You can either make them only readable by this user/group (more security): 440, readable by all users: 444, or readable and writable by all users: 666. The last case means that you don't need root access to edit config.inc.php or to make changes to the other php files (such as upgrades to a new version). Keep in mind that your mysql password is in config.inc.php, so if you've users on your system that are not allowed to know it, you should choose the first option. The directories should have execute rights: 550 for max security or 777 for access for all users.

To do this, first go to the directory directly above your Zoph directory, in this example /var/www/html

cd /var/www/html
chmod [dir] zoph
cd zoph
find -type f | xargs chmod [file]
find -type -d | xargs chmod [dir]

replace [dir] with the accesspattern you've chosen for directories above and replace [file] with the one for files.

Important!

Double check whether you are using the correct directory and if you have typed it correctly, if you would accidently type "/[space]var/www/html/zoph" or something, you would change all files on your entire system to apache/apache as owner - not good).

Install the perl scripts

Check the path to perl

The perl scripts points to /usr/bin/perl. If your perl is in a different place, edit the first line of the script.

Configure the database variables

Edit zophrc.sample (in the bin directory of the Zoph tar.gz) so that the following variables match the values you put in config.inc.php:

$db_host = 'localhost';
$db_name = 'zoph';
$db_user = 'zoph_rw';
$db_pass = 'pass';
$db_prefix = 'zoph_';
$image_dir = '/data/images/';

And then move this file to the home directory of the user you are planning on using to import photo's. Probably your own home directory. Save it under the name .zophrc.

You can also set some defaults in this file, in this way you do not need to always provide these commandline arguments:

$datedDirs = 0;
$copy = 0;
$hierarchical = 0;
$verbose = 0;
$resolveSymlinks = 0;

Make sure the file ends with

1;

Because Perl does not like it when the last assignment of the file is negative.

Or some other directory in your PATH.

Install the man page

A man page for zophImport is in the man/ directory. Copy this to somewhere in your manpath, /usr/local/man/man1 for example.

Test it

Try hitting http://localhost/zoph/logon.php. You should be presented with the logon screen. Log in using "admin" for user and "admin" for password.

If you get a 404 error...

If you see a bunch of code...

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
AddType application/x-httpd-php .php

If you see a MySQL access denied error...