Installation

From Chasers_wiki

Jump to: navigation, search

These instructions should be accurate for installing chasers_gpl_snapshot_1a, or from the Git repository.

If you downloaded the original snapshot_1, please use chasers_gpl_snapshot_1a instead.

Contents

Overview of Installing CHASERS

Installing CHASERS will involve installing Linux, and then possibly installing additional software needed for CHASERS, and installing CHASERS itself.

Installing Linux

Linux comes in lots of different flavors and varieties, known as "distributions." We don't have an opinion about which is best. We're using "Fedora", which is a very widely used distribution. The instructions we're providing here will most closely match with Fedora, so if you're just starting out and want to make things easy for yourself, you should probably use the current stable version of Fedora. The Fedora home page is at http://fedora.redhat.com/.

Documenting the installation of Fedora is beyond the scope of this Wiki. It is very likely, however, that you will find this to be a fairly easy process, and roughly comparable to installing Windows. During the installation process, if you check the "Server" option, most of the software you need for CHASERS will be automatically installed and configured, including Apache (Web Server), Postgres (SQL Database), and PHP (Scripting language).

After You Have Installed Linux

Install Required Software


Configure php.ini

  • Change this line in /etc/php.ini from:
allow_call_time_pass_reference = Off

to

allow_call_time_pass_reference = On
  • For testing purposes you might want to temporarily change display_errors in /etc/php.ini to log errors

Securing Your Web Connections

  • If you want to require SSL connections (recommended), and have installed mod_ssl, add the following lines to your Apache configuration file (/etc/httpd/conf/httpd.conf)
<Directory /var/www/html/chasers>
    AllowOverride All
</Directory>

(This means you will only be able to access CHASERS by https:, not http:)

Auto Start PostgreSQL and Web Server

  • To automatically start PostgreSQL and your web server when starting your computer, type the following in a command line:
 chkconfig --list postgresql
 chkconfig --level 345 postgresql on

 chkconfig --list httpd
 chkconfig --level 345 httpd on

If you want to try this before rebooting, you'll need to manually start postgresql and httpd:

/sbin/service postgresql initdb
/sbin/service postgresql start
/sbin/service httpd start

Configure Postgres to Allow Localhost Access

(There are a lot of ways to configure access. This is one way that should work.)

  • Edit /var/lib/pgsql/data/pg_hba.conf by adding these two lines before any others:
host     all     all     127.0.0.1/32     md5
host     all     all     ::1/128          md5
  • Reload the Postgres configuration
/sbin/service postgresql reload

CHASERS Install

Now that you've got the preliminary stuff out of the way, you're ready to install CHASERS. Just follow these steps:

Configure Error Logging

  • create appropriate error logging directory and touch the file
mkdir /var/log/chasers
touch /var/log/chasers/chasers_error.log

Create Database and User

Change to the CHASERS database directory:

cd /var/www/html/chasers/database/pg/client
(for versions later than 1a, replace "client" with "chasers_core")
  • Edit install.db.sql. Find this section, near the top:
/* --UNCOMMENT THIS SECTION TO CREATE DB AND DB USER

  CREATE USER {USER} PASSWORD '{PASSWORD}' NOCREATEDB NOCREATEUSER;
  CREATE DATABASE "{DATABASE}" OWNER "{USER}";

  \c {DATABASE}

*/

Replace {USER} with the desired username, {PASSWORD} with the desired password and {DATABASE} with the desired database name. You also need to uncomment this section, by removing the first and last lines.

  • If email notification is desired, download pgmail if you haven't already, and edit the pgmail function in install.db.sql by replacing the placeholder function:
/* replace this function with your actual email sending function (eg, pgmail) */
CREATE FUNCTION pgmail(text,text,text,text) RETURNS INTEGER AS $$
BEGIN
        RETURN 1;
END;$$ LANGUAGE plpgsql;

with the contents of pgMail.sql. You will need to fill in these two lines appropriately:

set myHost "<ENTER YOUR MAILSERVER HERE>"
puts $mySock "helo <ENTER YOUR DATABASESERVER HERE>"
  • Switch user (su) to postgres user and run the install.db.sql script:
su postgres
psql template1
\i install.db.sql
\q
exit

Create Initial Tables and Database Objects

  • Edit the password in add.initial_user.sql
INSERT INTO tbl_staff_password (staff_id,staff_password_md5,added_by,changed_by) 
        VALUES (2,md5('PASSWORD' /*CHANGE THIS TO THE DESIRED PASSWORD */),1,1);

(This should be a different username and password than the db user / password).
For more details on customizing the collection of installed CHASERS objects, see Installing Database Objects.

  • Run psql as the newly created user (from first step above):
psql -h localhost -U {USER} {DATABASE}

(replacing {USER} and {DATABASE} with the values you just chose.)

Enter the password you just chose.

Type the following commands:

For version 1a:

\i install.sql
\q

For versions later than 1a:

 \cd ..
 \i install.client_database.sql (or \i install.donor_database.sql)
 \q

Customize Local Configuration File

  • Copy the sample client or donor file to chasers_config_local.php
cd /var/www/html/chasers
cp chasers_config_local.sample.client chasers_config_local.php

and edit to indicate the user, database and password. You want to do this in the Postgres (not Mysql) section, so change these lines to match the database, username and password you specified before (you do not need to change the server line):

//Postgres:
$db_server["pg"]    = "localhost";
$db_user_name["pg"] = "Chasers";
$db_password["pg"]  = "";
$database["pg"]     = "Chasers";

Since chasers_config_local.php has your password in it, is is a good idea to make it only readable by Apache.

chown apache chasers_config_local.php
chmod 400 chasers_config_local.php
For Ubuntu, replace "apache" with "www-data" in the two lines above

Access CHASERS

You can now log in as super_user, with the password you specified earlier in add.initial_user.sql

Initial Steps in CHASERS

Housekeeping

  • Click on the link for the "CHASERS Administration" page, and find the "Database Maintenance" section.
  • Click the "enable table logging" link, which will allow "Revision History" tracking.
  • Click the "enable changed_at" link, which will make sure the modification times in your database are accurate

Add yourself as a new CHASERS user

  • Click on the "Add a new staff account" link (also on the CHASERS Administration page)
  • Fill in the appropriate values, and press submit
  • Review your record, and enter your password
  • You will now be on the staff page for your newly-created user
  • Click on the "change password" link to set your password

Make yourself a Super User

  • Click "Show Empty Records"
  • Click "Add a permission"
  • Choose "CHASERS Super User" as the permission type, fill in the rest of the form, and complete the record.
  • You can now log out as the "super_user," and log in as yourself

Enjoy!!!

Personal tools