Changes between Initial Version and Version 1 of InstallingEventViewer


Ignore:
Timestamp:
11/10/18 20:43:41 (7 years ago)
Author:
tbretz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InstallingEventViewer

    v1 v1  
     1The [https://www.fact-project.org/viewer/ Event Viewer] is a tool which allows to display raw data and manipulate raw data from a web browser. It is ideal to develop new algorithms without recompiling any code or writing a new framework. The disadvantage is that it is quite tedious to install. Here are some instructions.
     2
     3First, you need to checkou FACT++:
     4
     5{{{
     6[0] scn checkout https://www.fact-project.org/svn/FACT++
     7}}}
     8
     9Instructions how to compile FACT++ can be found here: InstallingFACT++. Compiling it with the TOOLS_ONLY option is enough.
     10
     11Now, you need to make sure that a web-server is installed, PHP is installed and the corresponding web-server configuration is set. For Ubuntu that means installing `apache2`, `php` and `libapache2.mod-php`.
     12
     13Usually, the default directory for user web-content is /home/user/public_html. When you think you have identified where you can put web-contents,  I suggest to test if everything works properly.
     14
     15Put a file `info.php` with the following contents there.
     16
     17{{{#!php
     18<?php
     19phpinfo();
     20?>
     21}}}
     22
     23Now, open your browser and browse that file through your web-server, e.g. `http://localhost/~user/info.php`. If you see the contents of the file, you still have to work on your configuration. If you see some nice table with php information, everything is ok.
     24
     25In newer Ubuntu versions, php for local directories is turned off. You need to enable it by commenting the follwing in `/etc/apache2/mods-enabled/php7.0.conf`
     26
     27{{{
     28# Running PHP scripts in user directories is disabled by default
     29#
     30# To re-enable PHP in user directories comment the following lines
     31# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
     32# prevents .htaccess files from disabling it.
     33#<IfModule mod_userdir.c>
     34#    <Directory /home/*/public_html>
     35#        php_admin_flag engine Off
     36#    </Directory>
     37#</IfModule>
     38}}}
     39
     40The next challenge is to get V8Js running, the V8 interface for PHP. You can use `pecl` to install it:
     41
     42{{{
     43[1] sudo pecl install v8js
     44}}}
     45
     46You will see some downloads and how pecl tries to configure the compilation. As V8Js requires a quite recent V8 library and current systems still come with a rather old one, you might see an error like this:
     47
     48{{{
     49checking for libv8_libplatform... configure: error: could not find libv8_libplatform library
     50ERROR: `/tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js' failed
     51}}}
     52
     53if this is the case, you need to install a recent version of V8. In case of Ubuntu (>=16.04), you can do that with
     54
     55{{{
     56[2] sudo add-apt-repository ppa:pinepain/libv8
     57[3] sudo apt-get update
     58[4] sudo apt install v8-6.6 v8-6.6-dev
     59}}}
     60
     61You need to install the libraries and the developer files. Now you can run ![1] again providing the correct installation path (in the case of the PPA, this is /opt/libv8-6.6) and everything should run through.
     62
     63Then you have to configure apache to use the new extension by adding `extension=v8js.so` to your `php.ini` (in Ubuntu it is found at /etc/php/7.0/apache2/php.ini).
     64
     65Now, reload the apache configuration
     66{{{
     67[5] sudo service apache2 reload
     68}}}
     69
     70I sugget to like the viewer directory in your public_html directory, e.g.
     71{{{
     72[6] cd ~/public_html
     73[7] ln -s [your-FACT++-directory]/www/viewer
     74}}}
     75
     76You should now be able to access the viewer from your web-browser as `http://localhost/~user/viewer/`. Ideally without getting an error (except that no files could be found)
     77
     78If that goes well, as a last step, you have to change the path to the FACT++ tool `getevent` and the paths to your data. As you will most likely only want to display raw data (Monte Carlo data and calibrated data needs special preparation), just add the path to your raw data three times.
     79
     80
     81
     82
     83
     84
     85