e-Logbook HowTo
Here is an example of how to set up and use the electronic logbook for a new experiment, let's say 'A2'.
Admin topics
These subsections would be of interest for an administrator who would like to set up such an electronic logbook.
Code
First thing, you have to obtain the source code (PHP, JS & HTML) from the author. Email the author for this,
stating what for and where you would like to install it.
Web server
Private functions and sessions history are kept in a directory outside the www tree:
mkdirhier /www/safe_dir/A2
cp private_func.php /www/safe_dir/A2/
chown apache /www/safe_dir/A2/private_func.php
But the directory
/www/safe_dir/A2/
has to be writeable by the
apache
user. Copy the indicated files therein.
Create the directory structure for the portal and file storage:
mkdirhier /www/html/site/A2/Logbook/files
chown -R apache /www/html/site/A2
The
/www/html/site/A2/Logbook/files
directory has to be writeable by the
apache
user as well. This is where the attachments will be stored
Copy over the necessary files.
Database
To create a database
A2
and tables, use the following commands:
mysql> CREATE DATABASE A2;
mysql> GRANT ALL ON A2.* TO 'A2_db_admin'@'localhost' IDENTIFIED BY '******';
mysql> FLUSH PRIVILEGES;
Then use the commands from the file
DATABASE.sql
(included in the code tarball) to create the tables, like this:
CREATE TABLE `Contacts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(60) DEFAULT NULL,
`email` varchar(60) DEFAULT NULL,
`phone` varchar(20) DEFAULT NULL,
`alt_phone` varchar(20) DEFAULT NULL,
`institute` int(3) DEFAULT NULL,
`homepage` varchar(120) DEFAULT NULL,
`registered` tinytext,
PRIMARY KEY (`id`)
);
and so on. In the end, you should have ten tables (not all are used for the eLog):
mysql> show tables from A2;
+------------------+
| Tables_in_A2 |
+------------------+
| Contacts |
| Experiments |
| Hardware |
| Institutes |
| Logbook |
| Parameters |
| ProcessVariables |
| Subgroups |
| Types |
| Units |
+------------------+
10 rows in set (0.00 sec)
Remember to replace
A2
with the actual name of your database.
Settings
Edit the file
elog_settings.php
as explained in the comments therein. You will set up filesystem paths, superuser list, the list of generic systems of
your setup (the others are taken from the Subgroups DB table), the attributes and types lists, some of the colors for the layout etc.
After you will be done playing with the interface, you will be able to hide all the test entries by modifying the
$oldest_entry
value.
Design a nice logo and save it in
/www/html/site/A2/images/logo.png
.
DB Tables
The only tables needed for using this kit as a logbook are:
Institutes
,
Contacts
,
Experiments
and
Subgroups
. The other tables are related to Process Variables, and would be
used for slow controls.
DB transfer problems
If the elog is moved to a new machine, with an older version of mysql, the mysql dump has to be compatible:
At origin (5.0.45):
mysqldump --user=root --opt --compact --compatible=mysql323 --password=xtehdsa A2 > /www/html/site/A2/A2-LOGBOOK-2010-04-08-323.SQL
gzip /www/html/site/A2/A2-LOGBOOK-2010-04-08-323.SQL
At destination (3.23.41):
wget http://nuclear.gla.ac.uk/A2/A2-LOGBOOK-2010-04-08-323.SQL.gz
gunzip A2-LOGBOOK-2010-04-08-323.SQL.gz
mysql -p -u A2_db_admin A2 < A2-LOGBOOK-2010-04-08-323.SQL
If the mysql socket is not in the usual place (
/tmp/mysql.sock
), then one can specify it in
mysql_connect(':/var/lib/mysql/mysql.sock', $user, $pass);
Authentication between these versions of mysql is different, so one may have to do this:
mysql> UPDATE mysql.user SET password=OLD_PASSWORD('xtehdsa') WHERE user='A2_db_admin' AND host='localhost';
mysql> flush privileges;
User topics
This electronic logbook software is currently used by
PANDA@FAIR,
A2@MAMI,
WASA-at-COSY experiments and by the
NDM initiative at CLAS. The subsections below are for general user reference.
Registration
The users can register via the online interface. To add users, see instructions in the
ACCESS
file included in the software tarball.
Validate at least one superuser account by editing the files located in the
/www/safe_dir/A2/
directory. Then log in as superuser and validate the other registrants.
Fill in the 'Institutes' and 'Contacts' DB tables.
Logbook entries
Logbook entries can be done via individual accounts, or one could create a generic account, say
a2online@mami.org
for shift summary entries. In the latter case,
the 'operators' entry field should be completed with the full names for the shift takers.
Manual
Here is a detailed A2 Logbook User Manual written by Ken Livingston:
elog_manual_8868213.pdf
imported from
http://nuclear.gla.ac.uk/twiki/bin/view.pl/Main/ELogHowTo
--
PeterZumbruch - 23 Aug 2012