Howto setup JS-ROOT

Hi! I have ROOT (including JS-ROOT) installed on Alma9 from EPEL.
I would like to setup JS-ROOT locally but i see no clear (apache) instruction to do so .. i have so far:

root@issaf: conf.d # cat jsroot.conf 
<FilesMatch "\.mjs">
  ForceType text/javascript
</FilesMatch>

but it’s not clear to me how to:

  1. enable the interface
    and
  2. associate the root files on the server to be opened with js-root

Thank you!
Adrian

Hi,

This is server-specific configuration. So can be found in correspondent documentation.

By the way - you can use server.py script which configures simple http server. It used by JSROOT testing tools.

Typically one provides file as URL parameter. If you are using default JSROOT GUI,
you can edit index.htm file and provide list of existing files as files attribute. Like:

<div id="simpleGUI" path="../files/" files="ct.root;exclusion.root;fillrandom.root;glbox.root;graph.root;hsimple.root;legends.root;rf107.root;stacks.root;zdemo.root">
         loading modules ...
 </div>

Hi! Could you point to me the “correspondent documentation”? looking at GitHub - root-project/jsroot: JavaScript ROOT for something related to apache i did not find anything ..

Regarding server.py : i had the impression that the js-root is a java interface (so run by the http server) not a stand-alone process that is accessed through a reverse-proxy in the httpd server.. did i got it wrong?

my goal is to have the interface that is seen at https://root.cern/js/latest/ and to have the ability that clicking on a root file on the server, the js-root to open that file.

Thanks a lot!!

JSROOT does not provide documentation for Apache configuration.
It can be very complex - but also there are extra GUI tools to configure web server on the host.

server.py runs very simple http server using Python.
But it is sufficient for JSROOT usage. See readme for how to use it. Once it running, you will be able to see default JSROOT page via URL: http://localhost:8000/jsroot/

No. JSROOT is pure JavaScript library and does not rely on any special http server functionality. Any http server can be used together with JSROOT.

Probably you speaking about ROOT webgui - which provides specialized http server to display graphics and GUI in web browser. But this functionality integrated into ROOT and does not require any extra http servers - one just run root --web hsimple.C

I’m sorry that i cannot communicate clear enough what i try to achieve… i will see if i can reformulate:

  1. The goal is to have a locally setup of js-root that would provide the functionality of https://root.cern/js/latest/
  2. I would like to NOT have to configure a reverse proxy in the apache server if i do not have to.
  3. I’m looking for documentation/example on how was this achieved at https://root.cern/js/latest/ .. is this possible, or is something private?

For private usage server.py is easiest way to achieve that you want - just run it as described in readme and try to use it.

It is not necessary for JSROOT.

As far as I know https://root.cern server managed by CERN IT and does not have any special components for JSROOT. Only extra .htaccess file placed in top folder to ease access to JSON and ROOT files. I attach it here.
htaccess.txt (750 Bytes)

So there are no any special magic behind http server for JSROOT.
http server just used as plain file server for JavaScript/HTML/ROOT files.
So any http server can do the job.

this is not for private usage, is for server usage

Great!

ok .. thank a lot! but it’s not clear to me what is the entry point for application .. it should be a .htm or .html file (or maybe a .js) that is what is started as index file

If one type URL http://localhost:8000/jsroot/, web browser tries to open file index.html or index.htm in this folder. So JSROOT provides such file. But there are other HTML files - like examples.htm or api.htm. They only accessible if addressed explicitly.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.