Changes between Version 1 and Version 2 of InstallingEventViewer

Nov 10, 2018, 9:45:34 PM (2 months ago)



  • InstallingEventViewer

    v1 v2  
    11The [ 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.
    3 First, you need to checkou FACT++:
     3== Requirements ==
     5== PHP ==
     7You need php installed. Otherwise, you will not be able to run the event viewer. In Ubuntu this is the package `php`.
     9== Getting FACT++ ==
     11First, you need to checkout FACT++ to get the tool `getevent`:
    9 Instructions how to compile FACT++ can be found here: InstallingFACT++. Compiling it with the TOOLS_ONLY option is enough.
     17Instructions how to compile FACT++ can be found here: InstallingFACT++. Compiling it with the TOOLS_ONLY option is enough. The web source code of the viewer is located now in FACT++/www/viewer.
    11 Now, 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`.
     19== V8 ==
     21To run the viewer, you need the V8 JavaScript engine installed. To be moe precise, you need the libraries and the development package (headers). A version of at least 5.6 is required. As most recent distributions ship with an older version. Tif you system uses apt (e.g. Ubuntu) you can check with
     24[1] apt list | grep libv8
     26libv8-3.14-dbg/xenial amd64
     27libv8-3.14-dev/xenial amd64
     28libv8-3.14.5/xenial,now amd64 [installed,automatic]
     29libv8-6.4/xenial 6.4.388.18-ppa1~xenial amd64
     30libv8-6.4-dbg/xenial 6.4.388.18-ppa1~xenial amd64
     31libv8-6.4-dev/xenial 6.4.388.18-ppa1~xenial amd64
     32libv8-6.5/xenial 6.5.144-ppa1~xenial amd64
     33libv8-6.5-dbg/xenial 6.5.144-ppa1~xenial amd64
     34libv8-6.5-dev/xenial 6.5.144-ppa1~xenial amd64
     35libv8-6.6/xenial,now 6.6.313-ppa1~xenial amd64 [installed]
     36libv8-6.6-dbg/xenial 6.6.313-ppa1~xenial amd64
     37libv8-6.6-dev/xenial,now 6.6.313-ppa1~xenial amd64 [installed]
     38libv8-dev/xenial,now amd64 [installed]
     41To install a newer version, you can either compile your own version ( or install some community maintained package. Here is an example:
     44[2] sudo add-apt-repository ppa:pinepain/libv8
     45[3] sudo apt-get update
     46[4] sudo apt install v8-6.6 v8-6.6-dev
     49This will install the headers and libraries into `/opt/libv8-6.6`.
     51== V8Js ==
     53Now you need the module which enables php to run V8Js ( Detailed installation instruction can be found in the README*.md files (Linux instructions:
     55If you have root rights, the easiest is to use pecl to install V8Js:
     58[5] sudo pecl install v8js
     61It will ask you for the installation directory of v8. In this example it is /opt/libv8-6.6.
     63Without root rights, the best is to do it also through pecl but locally:
     65[5] pecl bundle v8js
     66[6] cd v8js
     67[7] phpize
     68[8] ./configure --with-v8js=/opt/libv8-6.6
     69[9] make
     72You should now have a file `modules/` in the v8js directory.
     74== Local web-server ==
     76You can use a system web-server (apache2), but it might be difficult to configure. Some instruction will follow at the end of this document.
     78The easiest is to run a local web-server in user space. Fortunately, php comes with its own web-server exactly for this purpose. Its manual is available here
     81Start it in the veiwer directory with
     83[10] cd FACT++/viewer
     84[11] php -S localhost:5000
     87The viewer should now be accessible in your browser as `http://localhost:5000/index.html`.
     89If you get an error that V8Js is not properly installed, you might need to create a file `php.ini` with the following contents
     94If that does not work, you might have to use an relative or absolute path to ``.
     96Start your web-server now with
     98[10] cd FACT++/viewer
     99[11] php -S localhost:5000 -c php.ini
     102Now your viewer should load without an error.
     104== Apache/2 ==
     106If you want to use a global web-server, you can install `apache2`, `php` and `libapache2.mod-php`.
    13108Usually, 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.
    40 The next challenge is to get V8Js running, the V8 interface for PHP. You can use `pecl` to install it:
    42 {{{
    43 [1] sudo pecl install v8js
    44 }}}
    46 You 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:
    48 {{{
    49 checking for libv8_libplatform... configure: error: could not find libv8_libplatform library
    50 ERROR: `/tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js' failed
    51 }}}
    53 if this is the case, you need to install a recent version of V8. In case of Ubuntu (>=16.04), you can do that with
    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 }}}
    61 You 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.
    63135Then you have to configure apache to use the new extension by adding `` to your `php.ini` (in Ubuntu it is found at /etc/php/7.0/apache2/php.ini).
    67139[5] sudo service apache2 reload
    70 I 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 }}}
    76 You 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)
    78 If 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.