Java Web applet and Web based statistics: Difference between pages

From The DXSpider Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
(Created page with "==Java Web applet== In the spider tree will be a directory spider-web. This is a neat little java web applet that can be run from a website. The applet must run on the same machine as the cluster. The included README file is shown below. I should comment here that the applet is precompiled, that is, ready to go. It was compiled using JDK1.3.1. If your version is earlier than this then it may not work. Should that be the case you need to recompile or update your J...")
 
(Created page with "==Web based statistics== ===Generic installation=== From version 1.50, you can use the freeware software MRTG to produce really nice graphical statistics on your web site. For an example try http://www.gb7mbc.net/mrtg/stats.html. The following should help you get it all working. First you need to download the latest version of MRTG from http://people.ee.ethz.ch/~oetiker/webtools/mrtg/. You will also need the following files.. libpng-1.0.14.tar.gz zlib-1.1.4.tar....")
 
Line 1: Line 1:
==Java Web applet==
==Web based statistics==


In the spider tree will be a directory spider-web.  This is a neat little java web applet that can be run from a website.  The applet must run on the same machine as the cluster.  The included README file is shown below.
===Generic installation===


I should comment here that the applet is precompiled, that is, ready to go.  It was compiled using JDK1.3.1. If your version is earlier than this then it may not work.  Should that be the case you need to recompile or update your JDKTo recompile do the following ...
From version 1.50, you can use the freeware software MRTG to produce really nice graphical statistics on your web siteFor an example try http://www.gb7mbc.net/mrtg/stats.html.


cd /spider/spider-web
The following should help you get it all working.
rm *.class
/usr/bin/javac spiderclient.java


I have used /usr/bin/javac as an example, your path to javac may be different.
First you need to download the latest version of MRTG from http://people.ee.ethz.ch/~oetiker/webtools/mrtg/.  You will also need the following files..


===Spider-WEB v0.6b===
libpng-1.0.14.tar.gz
zlib-1.1.4.tar.gz
gd-1.8.3.tar.gz


Completely based on a clx web client written in Java by dl6dbh
Login to your machine as the root user, put all the downloaded files in /usr/local/src/ (or wherever you prefer) and untar and compile them. All the information to compile and install these sources come with them. After compilation and installation,  you will find MRTG in /usr/local/mrtg-2.
(ftp://clx.muc.de/pub/clx/clx-java_10130001.tgz)


The webserver has to run on the same machine as your DxSpider software!
Now copy all the files in /usr/local/src/mrtg-2.9.22/images/ to /spider/html/mrtg/


It is assumed that you have Java installed.  You need JDK1.3.1 at least.
You now need to make 2 symbolic links like below...


===Installation instructions (Performed as root):===
ln -s /usr/local/mrtg-2/bin/mrtg /usr/bin/mrtg
ln -s /usr/local/mrtg-2/lib/mrtg2 /usr/lib/mrtg2


Put all the files in the spider-web directory into a newly created directory under the DocumentRoot of your websever for instance 'client'. In my case this is: /home/httpd/html/client/ although ymmv.  For Suse the correct path should be /usr/local/httpd/htdocs/client/ for example.
Now login to the cluster with your sysop callsign and run the command "mrtg all".


Move spider.cgi to the cgi-bin directory of your webserver, in my case that is /home/httpd/cgi-bin/ although ymmvFor Suse the correct path should be /usr/local/httpd/cgi-bin/ for example.
Now you are nearly there!  Login as the sysop user and change to the /spider/html/mrtg/ directoryNow run the command indexmaker as shown below...


Change the permissions of the files to ensure they are correct, obviously you will need to use the correct path the the files according to your system:
indexmaker --output stats.html --columns=1 --title "MRTG statistics for GB7DJK" ../../mrtg/mrtg.cfg


chmod 755 /home/httpd/html/cgi-bin/spider.cgi
Changing the callsign for your own cluster callsign of course!
chmod -R 755 /home/httpd/html/client/


By default the spider.cgi script should pick up your hostname (As long as this is set correctly)If it does not or your hostname differs from the name that you attach to the public address that you are using, then edit spider.cgi :
And finally you need to login as the root user and create one last symbolic link. Where this points will depend on where your html documents are keptFor RedHat systems you use...


  # Uncomment and set the hostname manually here if the above fails.
  ln -s /home/sysop/spider/html/mrtg /home/httpd/html/mrtg
# $HOSTNAME = "gb7mbc.spoo.org" ;
$PORT = "8000" ;


The port number will be the same as the one defined in Listeners.pm
and for SuSE systems...


NOTE: If you can start the console but cannot connect to the cluster from it, then it is possible that the machine you are on cannot resolve the hostname of your cluster machine. If this is the case, you need to set your hostname manually as above.
  ln -s /home/sysop/spider/html/mrtg /usr/local/httpd/htdocs/mrtg


You also need to set the $NODECALL variable.  This prints the name of your choosing (probably your cluster callsign) on the html page.
If you now point your browser to your website as below it should all be happening!


You now can connect to Spider-Web via http://yourserver/cgi-bin/spider.cgi
http://www.xxx.xxx/mrtg/stats.html
 
Of course, to get the stats to update, you need to add some information in the spider crontab file as below...
 
# Update stats for mrtg on website
00,05,10,15,20,25,30,35,40,45,50,55 * * * * run_cmd('mrtg all')
 
This will update the site every 5 minutes.
 
===Ubuntu 8.04 Installation===
 
To install on the latest versions of Ubuntu (8.04 at the time of writing) is really very simple.  Either use Synaptic or apt-get install to get the latest mrtg.  Once you have done this and it is installed, do the following..
 
chmod 01777 /var/lock mrtg /var/lib/mrtg
 
Now log into the cluster using your sysop console and issue the command..
 
mrtg all
 
log in at the command line as the user 'sysop' and type the following commands..
 
cd /spider/html/mrtg
 
indexmaker --output stats.html --columns=1 --title "MRTG statistics for GB7DJK" ../../mrtg/mrtg.cfg
 
Making sure you change GB7DJK to your own cluster node call!
 
Finally create the following symlink
 
ln -s /home/sysop/spider/html/mrtg /var/www/mrtg
 
and all should now be working!  You can create a crontab entry as above.

Latest revision as of 08:21, 1 February 2023

Web based statistics

Generic installation

From version 1.50, you can use the freeware software MRTG to produce really nice graphical statistics on your web site. For an example try http://www.gb7mbc.net/mrtg/stats.html.

The following should help you get it all working.

First you need to download the latest version of MRTG from http://people.ee.ethz.ch/~oetiker/webtools/mrtg/. You will also need the following files..

libpng-1.0.14.tar.gz
zlib-1.1.4.tar.gz
gd-1.8.3.tar.gz

Login to your machine as the root user, put all the downloaded files in /usr/local/src/ (or wherever you prefer) and untar and compile them. All the information to compile and install these sources come with them. After compilation and installation, you will find MRTG in /usr/local/mrtg-2.

Now copy all the files in /usr/local/src/mrtg-2.9.22/images/ to /spider/html/mrtg/

You now need to make 2 symbolic links like below...

ln -s /usr/local/mrtg-2/bin/mrtg /usr/bin/mrtg
ln -s /usr/local/mrtg-2/lib/mrtg2 /usr/lib/mrtg2

Now login to the cluster with your sysop callsign and run the command "mrtg all".

Now you are nearly there! Login as the sysop user and change to the /spider/html/mrtg/ directory. Now run the command indexmaker as shown below...

indexmaker --output stats.html --columns=1 --title "MRTG statistics for GB7DJK" ../../mrtg/mrtg.cfg

Changing the callsign for your own cluster callsign of course!

And finally you need to login as the root user and create one last symbolic link. Where this points will depend on where your html documents are kept. For RedHat systems you use...

ln -s /home/sysop/spider/html/mrtg /home/httpd/html/mrtg

and for SuSE systems...

ln -s /home/sysop/spider/html/mrtg /usr/local/httpd/htdocs/mrtg

If you now point your browser to your website as below it should all be happening!

http://www.xxx.xxx/mrtg/stats.html

Of course, to get the stats to update, you need to add some information in the spider crontab file as below...

# Update stats for mrtg on website
00,05,10,15,20,25,30,35,40,45,50,55 * * * * run_cmd('mrtg all')

This will update the site every 5 minutes.

Ubuntu 8.04 Installation

To install on the latest versions of Ubuntu (8.04 at the time of writing) is really very simple. Either use Synaptic or apt-get install to get the latest mrtg. Once you have done this and it is installed, do the following..

chmod 01777 /var/lock mrtg /var/lib/mrtg

Now log into the cluster using your sysop console and issue the command..

mrtg all

log in at the command line as the user 'sysop' and type the following commands..

cd /spider/html/mrtg
indexmaker --output stats.html --columns=1 --title "MRTG statistics for GB7DJK" ../../mrtg/mrtg.cfg

Making sure you change GB7DJK to your own cluster node call!

Finally create the following symlink

ln -s /home/sysop/spider/html/mrtg /var/www/mrtg

and all should now be working! You can create a crontab entry as above.