Re: anybody with gwstat?
Martin Olsson - Webmaster Studentdatorutskottet V-as (web@mds.mdh.se)
Mon, 4 Nov 1996 14:49:00 +0100 (MET)
> Has anyone tested wwwstat-2.0b1 with gwstat?
Yepp, it works great.
I make some changes to the wwwstat output before I send it to gwstat
though.
I run wwwstat with:
$DefaultLog =3D '/usr/www/httpd_data/statistik/requests_converted';
$InsertLink =3D 1;
$SortDomain =3D 1;
$SortSubdomain =3D 1;
$SortArchive =3D 1;
$SortIdent =3D 1;
... which gives me a GREAT html-file with sorted data and links to all th=
e
files. It's easy to see what pages are the most popular (as a webmaster I
must see to that there are no ponography on my site, and the wwwstat
output with links are great!)
--- Here's the script I run 00:00 every night as a cron-job ------------
#!/bin/sh
PATH=3D$PATH:/usr/local/bin
export PATH
#Convert phttpd-log to HTTPd-format (buffer dates 1-9 with a leading '0')
/bin/cat /opt/www/log/requests | sed 's@\[\([0-9]\)/@\[0\1/@g' > /usr/www=
/httpd_data/statistik/requests_converted
#Clear webserver's request-log
/usr/ucb/echo -n "" > /opt/www/log/requests
###Create web-info with wwwstat
#Make yesterdays wwwstat output an input-file
/bin/mv -f /usr/www/httpd_data/statistik/wwwstat.htm /usr/www/httpd_data/=
statistik/wwwstat_old.htm
#Run wwwstat with the above file and the converted logfile as input
/opt/www/wwwstat-2.0b1/wwwstat -- /usr/www/httpd_data/statistik/wwwstat_o=
ld.htm + > /usr/www/httpd_data/statistik/wwwstat.htm
#Remove yesterdays wwwstat output
/bin/rm -f /usr/www/httpd_data/statistik/wwwstat_old.htm
#Delete the converted logfile
/bin/rm -f /usr/www/httpd_data/statistik/requests_converted
#Restart the webserver (not necessary)
/opt/www/bin/make_server stop > /dev/null
/opt/www/bin/make_server start > /dev/null
###Reduce the wwwstat output (remove pictures, Code XXX, ...)
###(I only want the HTML-files themselves on my toplist, not what icon
###has been requested the most)
#Remove all HTML-links, keep only the filenames
/bin/cat /usr/www/httpd_data/statistik/wwwstat.htm | /bin/sed 's/ | <a hr=
ef=3D".*">/ | /g' > /usr/www/httpd_data/statistik/wwwstat_reduced.htm
/bin/cat /usr/www/httpd_data/statistik/wwwstat_reduced.htm | /bin/sed 's/=
<\/a>$//g' > /usr/www/httpd_data/statistik/wwwstat_reduced.temp
#Remove pictures, icons, error-codes and the webcam page
/bin/cat /usr/www/httpd_data/statistik/wwwstat_reduced.temp | /bin/egrep =
-i -v ".gif$|.jpg$|.jpeg$|Server Icons$|Code |/cgi-bin/webcam/$" > /usr/w=
ww/httpd_data/statistik/wwwstat_reduced.htm
#Run gwstat (create GIF-pictures of the reduced wwwstat output, sort the
#files and domainnames)
/opt/www/gwstat/gwstat -n
#Delete the reduced info
/bin/rm -f /usr/www/httpd_data/statistik/wwwstat_reduced.htm
/bin/rm -f /usr/www/httpd_data/statistik/wwwstat_reduced.temp
#Change owner of the files to me, since root is running the cron-job
/bin/chown -R web /usr/www/httpd_data/statistik/
exit 0
--------------------------------------------------------------------
/\ /\ /\
/S/\ /M/\ /M/\ Studentdatorutskottet webmaster@mds.mdh.se
\/d/\ \/d/\ \/d/\ M=E4lardalens Studentk=E5r http://www.mds.mdh.se/
\/U/ \/S/ \/H/ M=E4lardalens H=F6gskola Phone: +46-21-103111
\/ \/ \/