Installation

Jason Pell edited this page Jun 21, 2013 · 1 revision

Table of Contents

Requirements

To install the Open Media Collectors Database (OpenDb) on your site, you will need the following:

  • WebServer (Apache 1.3, 2.x, IIS,...) - Apache is recommended, but IIS should work too.
  • PHP 4.3.0+, 5.X
    • track_vars must be enabled.
    • register_globals can be enabled/disabled.
    • php-mysql module must be installed, so that PHP can access MySQL.
    • php-gd module for image thumbnail generation.
  • MySQL Database 4.X, 5.X
  • SMTP server or PHP email configured. If this is not possible, be sure to set the email configuration Mailer to 'none'.

Installation / Upgrade

  • Download the current OpenDb package
  • Unzip it locally, preserving the directory structure.
  • Copy all files and directories to your webserver -- creating a new directory, e.g. http://www.mysite.com/opendb/
  • Run the OpenDb installer, by opening the install.php in your browser. Use a URL something like http://www.mysite.com/opendb/install.php
  • The OpenDb installer can create your MySQL user and database if you can provide a MySQL root username and password. However, if you do not have that information, you may create a MySQL user and database for OpenDb to be installed into. You must ensure that the user has the following database permissions:
    • SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, LOCK TABLES

Gotchas

Ensure when you upload the OpenDb package contents to your server via FTP, that your FTP client maintains the case of all files. There has been a case recently where a user inadvertently uploaded their files with a FTP client profile that set all filenames to lowercase - this breaks OpenDb severely!!!

Its extremely important to make a new directory for the 1.0 installation files, do not extract 1.0 files over the top of your existing 0.81 installation. There is a very good chance that conflicts between the old and new files will occur and this must be avoided.

OpenDb's Database

Option 1 - Create a new database

It's best to create a new database specifically for OpenDb and not rely on an existing database. Follow your hoster's directions for creating a database and give it a name such as opendb. Similarly, create a database user (and password) with the required privileges. The easiest way to create a new database and user is with phpMyAdmin.

Note: phpMyAdmin is a separate product for managing mySQL databases. Please refer to phpmyadmin.net for support or installation questions.

Option 2 - Use an existing database

A lot of web hosters do not support the creation of new databases. They only provide one database and limit you to it.

In this case, you should ensure that you configure the Table Prefix in the database connection details screen of the installer.

Installer

The installer is fairly self-explanatory and in most cases, will automatically perform the appropriate upgrades without anything more from you than clicking the Next and Continue buttons.

The install.php should be removed from the root directory of the opendb installation once the installation / upgrade process is complete.

TODO - Provide detailed steps for installation process.

Upgrading process

  • When you run install.php on a installed OpenDb site, OpenDb performs a pre-upgrade check of your PHP settings and the directories that must exist and be writable (on Linux/Unix systems) for OpenDb to function correctly.
    • The writable directories are:
      • include
      • log
      • itemcache
      • httpcache
      • importcache
    • If the directories are not writable, the following Linux/Unix command may make them so. Execute it from the command line and then click the Retry button.
      • chmod ugo+w include log itemcache httpcache importcache
    • Once all's good, click the Next button.
  • The OpenDb Database Configuration screen asks, "What database do you want to use for your OpenDb installation?" Use the form to provide the following information. The default info is in italics; substitute your info here:
    • MySQL Database Hostname: localhost
    • MySQL Database Name: opendb
    • MySQL User Name: lender
    • MySQL User Password: test
    • Table Prefix: [optional]
  • Optional: If the specified database and/or user do not already exist, the OpenDb installer can create them, but only if MySQL 'Root' User credentials are provided that have permission to CREATE DATABASE and GRANT ALL PRIVILEGES.
  • The installer then confirms these credentials with you before proceeding. Click the Continue button if they are correct.
  • If all goes as planned, you be informed that "OpenDb configuration was written to ./include/local.config.php". And then: "Pre install checks have been completed. Your OpenDb database will now be checked to see if upgrades are required". Click the Next button.
  • The installer will now step you through any needed changes to your database. Click the Execute Step button until finished. (The last one is labeled "Finalise upgrade".)
  • After following these steps, you should be informed that "Your OpenDb installation is up to date." And are given a link to login to your OpenDb installation. Congratulations!

Post Installation

Cover Image Cache (upload/ directory)

When you upgrade from 0.81, if you have any locally saved cover images, you must copy the upload/ directory over to the new 1.0 installation, so that cached images can continue to be served.

Admin User configuration

By default, if you execute a new installation, a Administration user is created with a userid of admin and a password of admin. Its a very good idea to immediately change the password of this user.

The admin user is configured with a Email address of opendb@iamvegan.net that should be immediately modified to your own address, so that you can receive registration signup and other emails.

Configuration and Logfile Security

By default the logfile can be accessed from the browser using the /log/usagelog.txt URL. You should immediately secure the log/ directory to prevent this.

The same is true about the configuration which is generated during the install process and stored in the /config directory: /config/config.inc.php might be read out over the web using special tools (TODO give examples of such tools or ways how to read out). This file contains your database access credentials (server, database, username and password) therefore you should restrict access to it immediately.

Secure the two directories via Web Server configuration. For example, this is a sample Apache 1.3.x configuration for Opendb. The /opendb/config and /opendb/log virtual locations have been made inaccessible from a browser with the second directive.

 <Location "/opendb/config/">
  order deny,allow
  deny from all
 </location>
 
 <Location "/opendb/log/">
  order deny,allow
  deny from all
 </location>