By adding one ROOT specific module to your Apache web server you can distribute ROOT files to any ROOT user. No need anymore for ftp'ing files containing (out of date) histograms or other objects. Your latest up-to-date results are always accessable to all your colleagues.
How to access ROOT files via a web server. Simple, just create a TWebFile object instead of a TFile object with a standard URL as file name. For example:
root [0] TWebFile
f("http://root.cern.ch/~rdm/hsimple.root")
root [1] f.ls()
TWebFile** http://root.cern.ch/~rdm/hsimple.root
TWebFile* http://root.cern.ch/~rdm/hsimple.root
KEY: TH1F hpx;1 This is the px distribution
KEY: TH2F hpxpy;1 py vs px
KEY: TProfile hprof;1 Profile of pz versus px
KEY: TNtuple ntuple;1 Demo ntuple
root [2] hpx.Draw()
Since TWebFile inherits from TFile all TFile operations work as expected. However, due to the nature of a web server a TWebFile is a readonly file. A TWebFile is ideally suited to read relatively small objects (like histograms or other data analysis results). Although possible, you don't want to analyse large TTree's via a TWebFile.
Here follows a step-by-step recipe for making your Apache 1.1 or 1.2 web server ROOT aware:
If you have Apache 1.3 you can also add modules without recompiling the server source. Do the following to compile and add the file mod_root133.c:
"LoadModule root_module /usr/lib/apache/mod_root.so"This points Apache to the shared object if mod_root is being used as loadable module.
"AddHandler root-action root"
That's all.