hello,
I have written a perl scripts which calls root in the background to produce dynamically (from user request) plots out of an existing root file. I have successfully tested this on a local webserver. But now I tried to run this on the CERN webserver. The problem is how to initialize/call root on the CERN webserver (like setting ROOTSYS).
Has anybody experience with this? Unfortunately I didn’t get any help from the websupport concerning root.
thanks in advance
greetings
doris
Doris,
I don’t think that the CERN security guys will authorize running ROOT in the webserver. However, there is a much simpler solution to this problem.
You can access any ROOT file reachable from a web server from any client on a remote machine. You need ROOT version 5.16 or 5.17
For example, from any ROOT client you can do the following:
root > TFile *f = TFile::Open("http://root.cern.ch/files/pippa.root")
root > TBrowser b
and browse the …. file visible in teh left pane of the browser
or alternatively, do, eh
root > TH1 *h = (TH1*)f->Get("DM/CJ/h6");
root > h->Draw()
and soon you will be able to browse directly a web page containing ROOT files, CINT scripts, ps, .gif, etc
Rene
I can’t comment on what the CERN website will allow you to run root. I would hope that there is a website somewhere on CERN where you would be allowed to (for many applications, having access to the root files is not sufficient).
For the original question, you have a couple of options. The first one (probably easier) is to run a shell script from your CGI script where the shell script sets up the environment and then runs root with the proper arguments.; this is what I do and it works well Another option would be to set the environment variables inside the CGI script. The variables would then be available for subsequent processes (i.e., root).
Cheers,
Charles