#!/star/Perl/bin/perl
$SERVERNAME="horus";
$BASEWWWURL="http://horus.roe.ac.uk/data/wsa/";
$BASECGIURL="http://horus.roe.ac.uk/wsa/";
$BASEJSPURL="http://horus.roe.ac.uk:8080/wsa/";
$BASEWWWDIR="/data/wsa/";
$WEBPROGSDIR="/home/mar/webprogs/";
$TMPWEB="/data/wsa/tmp/";
$IMCOPY=$WEBPROGSDIR."imcopy";
$SVNDIR="/home/mar/svn/webpages";
$SVNCMD="/usr/bin/svn";
$WORKDIR="/home/mar/build/wsa";
$ENV{'PFILES'} = "/home/scos/usr/local/heasoft/ftools/x86_64-unknown-linux-gnu-libc2.7/syspfiles/";
$ENV{'PATH'} = "/star/java/jre/bin:/star/java/bin:/home/mar/bin:/home/scos/usr/local/bin:/home/scos/usr/local/wsa/bin:/home/scos/usr/local/unixODBC/bin:/home/scos/usr/local/wxPython/bin:/home/scos/usr/local/wxPython:/home/scos/usr/local/heasoft/x86_64-unknown-linux-gnu-libc2.7/bin:/usr/local/bin:/star/local/bin:/usr/bin:/bin:/usr/sbin:/usr/bin/X11:/star/bin/startcl:/star/bin:/star/starjava/bin";

#$ENV{'PATH'} = "/usr/bin:/bin:/home/nch/bin:/home/mar/webprogs:/home/mar/wsa:/home/scos/usr/local/bin:/home/scos/usr/local/wsa/bin:/home/scos/usr/local/unixODBC/bin:/home/scos/usr/local/wxPython/bin:/home/scos/usr/local/wxPython:/home/scos/usr/local/heasoft/i686-pc-linux-gnu/bin:/usr/local/bin:/star/local/bin:/usr/bin:/bin:/usr/sbin:/usr/bin/X11:/star/bin/startcl:/star/bin:/star/starjava/bin";

$ENV{'LD_LIBRARY_PATH'} = "/home/scos/usr/local/lib64:/home/scos/usr/local/lib:/home/scos/usr/local/unixODBC/lib:/home/scos/usr/local/wxPython/lib:/home/scos/usr/local/lib/python2.5/site-packages:/home/scos/usr/local/atlas/lib:/home/scos/usr/local/heasoft/x86_64-unknown-linux-gnu-libc2.7/lib:/star/lib:/lib:/usr/lib:/star/lib:/star/starjava/lib/amd64";
#$ENV{'LD_LIBRARY_PATH'} = $ENV{'LD_LIBRARY_PATH'}.":/star/lib:/home/scos/usr/local/lib64:/home/scos/usr/local/lib:/home/scos/usr/local/unixODBC/lib:/home/scos/usr/local/wxPython/lib:/home/scos/usr/local/lib/python2.5/site-packages:/home/scos/usr/local/atlas/lib:/home/scos/usr/local/heasoft/i686-pc-linux-gnu/lib:/star/lib:/lib:/usr/lib:/star/lib:/star/starjava/lib/amd64";
$ENV{'PYTHONPATH'} = ".:/home/scos/usr/local/wsa/lib:/home/scos/usr/local/lib/python2.5:/home/scos/usr/local/lib/python2.5/site-packages:/home/scos/usr/local/lib:/home/scos/usr/local/unixODBC/lib:/home/scos/usr/local/lib/python2.5/site-packages/mx:/home/scos/usr/local/lib/python2.5/site-packages/mx/ODBC:/home/mar/VDFS/release/src/curation";

#$ENV{'PYTHONPATH'} = $ENV{'PYTHONPATH'}.".:/home/scos/usr/local/wsa/lib:/home/scos/usr/local/lib/python2.5:/home/scos/usr/local/lib/python2.5/site-packages:/home/scos/usr/local/lib:/home/scos/usr/local/unixODBC/lib:/home/scos/usr/local/lib/python2.5/site-packages/mx:/home/scos/usr/local/lib/python2.5/site-packages/mx/ODBC:/home/mar/VDFS/release/src/curation";
$ENV{'LD_RUN_PATH'} = "/home/scos/usr/local/lib64:/home/scos/usr/local/lib:/home/scos/usr/local/lib/python2.5/site-packages:/home/scos/usr/local/atlas/lib";
#$ENV{'LD_RUN_PATH'}.":/home/scos/usr/local/lib64:/home/scos/usr/local/lib:/home/scos/usr/local/lib/python2.5/site-packages:/home/scos/usr/local/atlas/lib";
$ENV{'PYTHONVER'} = "python2.5";
$HTMLDOCCMD="/home/mar/htmldoc-1.8.27/htmldoc/htmldoc ";
$logDir=$TMPWEB."logs/";

sub cgiLog {
    my $cgiName=$_[0];
    my $ip=$_[1];
    my $bytesSent=$_[2];
    my $extra=$_[3];
    my $err=$_[4];
    my $logString=$cgiName.",".$ip.",".$bytesSent.",".$extra.",".$err;
($sec,$min,$hour,$day,$mon,$year,$a1,$a2,$a3) = localtime (time);

$year=$year+1900;
$thisMonth= (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon];
$mon++;
$timeStamp=sprintf("%02d",$day)."/".$thisMonth."/".$year." ".sprintf("%02d",$hour).":".sprintf("%02d",$min).":".sprintf("%02d",$sec);
$logFile=$logDir."cgi".$year."_".sprintf("%02d",$mon)."_".sprintf("%02d",$day).".log";
$logString=$timeStamp.",".$logString;
open(LOGFILE, ">> $logFile") || die "cant open logfile: $!";
print LOGFILE "$logString\n";
close(LOGFILE);
} 
