HRDIODB
[ class tree: HRDIODB ] [ index: HRDIODB ] [ all elements ]
HRDI Observational Database Documentation

HRDI Observational Database Documentation

Table of Contents

Overview

The HRDIODB web interface is a tool for browsing, downloading, and performing limited editing on a body of information retrieved from the High Resolution Doppler Imager (HRDI). Information is stored both in a MySQL database and as data files on the server. The HRDIODB web interface connects the database to the files and permits searching of data and downloading of files (by registered users). The HRDIODB code also has a command line CSV uploader script for populating the database and performing routine updates.

The process starts with the upload_csv.php script which uses the csv_loader class to populate the database. CSV files must first be placed on the file system by some means. They are then parsed by the CSV loader and loaded into the database. After data is loaded, it can be viewed through the HRDIODB web interface in both day and week view. The data may also be searched in many ways using the free form search, or in specific ways using the predefined search forms.

The HRDIODB interface is also responsible for performing user authentication. All user information is stored in a simple database table, with passwords stored as MD5 hashes. Authenticating allows regular users to download files, tracking their downloads in the database as well. Users can be given administrator privileges by enabling their admin flag in the database. This has to be done manually, either through the mysql command line client or by using phpMyAdmin. Administrators are allowed to edit various information through the day edit interface. They can also add, edit and delete day modes through the mode edit interface. All changes are logged in the database and the previous values are kept in a retrievable format (see http://www.php.net/serialize and http://www.php.net/unserialize).

All code relies on the hrdi_db class for database access. The hrdi_db class is a child of the mcpear class, which is a wrapper around the popular PEAR DB PHP library (see Third Party Libraries). Since PEAR DB supports a wide variety of databases, this allows HRDIODB data to be stored in any of them.


System Requirements

The following setup is required in order to run the HRDIODB code.

  • Web server capable of running PHP
  • PHP 4.3.2 with PEAR support
  • PEAR DB compatible database

System Recommendations

The following setup is recommended by the HRDIODB authors.


Browsers

In order for all code features to work properly, a JavaScript capable web browser with cookies enabled is required. The authors recommend Firefox for its compliance with web standards, ease of use, security, privacy features and stability.


Installation Instructions

  • Uncompress the HRDI code archive. Assuming the file is called hrdi.tar.gz, issue a command like the following:

    tar zxvf hrdi.tar.gz

  • Create a HRDIODB database schema using the database schema file. Assuming the file is called hrdi-mysql-schema.sql, the database is called hrdiodb and the privileged user is hrdi, issue a command like the following:

    mysql -u hrdi -p hrdiodb < hrdi-mysql-schema.sql

  • Copy the file conf.dist.php to conf.php.
  • Edit conf.php to match your desired HRDIODB configuration. Comments inside the file explain every available option.
  • Populate the database using the upload_csv.php script and CSV files.

Server Notes

It appears that Fedora has a slight bug in either its PHP or Apache packages. The Apache package needs to to be able to write PHP session files to the file system. By default, the location for the session files is /var/lib/php/session/. In order for Apache to be able to write the session files, it needs to have write permissions on the directory. Fedora's Apache, by default, runs as user 'nobody' and group 'nobody'. On the other hand, the default owner of the /var/lib/php/session/ directory is 'root' and group 'apache', with a 770 mode. This means that the Apache process cannot write to the directory, hence PHP is unable to store a session. This results in a user logging in to the HRDIODB code, not getting a login error, but then being redirected to a page and still not being logged in.

In order to fix the permissions, the following commands should be run as 'root':

chgrp nobody /var/lib/php/session/

This will change the group ownership of the directory to 'nobody', which, with the 770 mode, will allow Apache to write the session files.


License

The HRDIODB code is released under the GPL. The license itself can be found in the file named COPYING, which should be included with the code, or it can also be viewed online. The mode editing icons are borrowed with thanks from the phpMyAdmin project.



Documentation generated on Tue, 23 Jan 2007 22:57:42 -0500 by phpDocumentor 1.3.0RC6