From: eldy <> Date: Sun, 21 Dec 2003 15:06:39 +0000 (+0000) Subject: Updated documentation. X-Git-Tag: AWSTATS_6_0_BETA~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbffa0cdae3cdf36ce66646ff738031445bccb13;p=thirdparty%2FAWStats.git Updated documentation. --- diff --git a/tools/configure.pl b/tools/configure.pl index cec435e9..be186862 100644 --- a/tools/configure.pl +++ b/tools/configure.pl @@ -29,9 +29,9 @@ $AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon'; $AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css'; $AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes'; $AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin'; -$AWSTATS_TOOLS_PATH='/usr/local/awstats/wwwroot/tools'; # Used for linux only -$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used for linux only -$AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used for linux only +$AWSTATS_TOOLS_PATH='/usr/local/awstats/wwwroot/tools'; # Used only when configure ran on linux +$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used only when configure ran on linux +$AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used only when configure ran on linux @@ -231,10 +231,10 @@ if ($QueryString =~ /debug=/i) { $Debug=$QueryString; $Debug =~ s/.*debug=//; $D my $helpfound=0; my $OS=''; my $CR=''; -my $AWSTATS_PATH=''; # Used for windows only +my $AWSTATS_PATH=''; # Used only when configure ran on windows for (0..@ARGV-1) { if ($ARGV[$_] =~ /^-*h/i) { $helpfound=1; last; } - if ($ARGV[$_] =~ /^-*awstatspath=([^\s\"]+)/i) { $AWSTATS_PATH==$1; last; } + if ($ARGV[$_] =~ /^-*awstatspath=([^\s\"]+)/i) { $AWSTATS_PATH=$1; last; } } if (! $AWSTATS_PATH) { $AWSTATS_PATH=$DIR||'..'; @@ -284,6 +284,15 @@ else { $OS='windows'; $CR="\r"; } #print "Running OS detected: $OS (Perl $^[)\n"; print "\n-----> Running OS detected: $OS\n"; +if ($OS eq 'windows') { + # We do not use default values for awstats directives + # but thoose defined from AWSTATS_PATH + $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon"; + $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css"; + $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes"; + $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin"; +} + # Detect web server path # ---------------------- print "\n-----> Check for web server install\n"; @@ -411,19 +420,19 @@ foreach my $key (keys %ApacheConfPath) { print CONF "# Directives to allow use of AWStats as a CGI$CR\n"; print CONF "#$CR\n"; if (! $awstatsclassesfound) { - print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"' to config file\n"; + print " Add 'Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"'\n"; print CONF "Alias \/awstatsclasses \"$AWSTATS_CLASSES_PATH\/\"$CR\n"; } if (! $awstatscssfound) { - print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"' to config file\n"; + print " Add 'Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"'\n"; print CONF "Alias \/awstatscss \"$AWSTATS_CSS_PATH\/\"$CR\n"; } if (! $awstatsiconsfound) { - print " Add 'Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"' to config file\n"; + print " Add 'Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"'\n"; print CONF "Alias \/awstatsicons \"$AWSTATS_ICON_PATH\/\"$CR\n"; } if (! $awstatscgifound) { - print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"' to config file\n"; + print " Add 'ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"'\n"; print CONF "ScriptAlias \/awstats\/ \"$AWSTATS_CGI_PATH\/\"$CR\n"; } close CONF; @@ -549,8 +558,8 @@ if ($WebServerChanged) { # ------------------------------- print "\n-----> Add update process inside a scheduler\n"; if ($OS eq 'linux') { - print "Sorry, programming update is not supported yet.\n"; - print "You can do it manually by adding the following line to your crontab\n"; + print "Sorry, configure does not support automatic add to cron yet.\n"; + print "You can do it manually by adding the following command to your cron:\n"; print "$AWSTATS_CGI_PATH/awstats -update -config=".($site?$site:"myvirtualserver")."\n"; print "Or if you have several config files and prefer having only one command:\n"; print "$AWSTATS_TOOLS_PATH/awstats_updateall.pl now\n"; diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 81563e62..f83cc13d 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -766,7 +766,9 @@ sub error { } if (! $ErrorMessages && ! $donotshowsetupinfo) { if ($message =~ /Couldn.t open config file/i) { - my $dir=$DIR; $dir =~ s/[\\\/]?wwwroot[\/\\]cgi-bin[\\\/]?//; + my $dir=$DIR; + if ($dir =~ /^\./) { $dir.='/../..'; } + else { $dir =~ s/[\\\/]?wwwroot[\/\\]cgi-bin[\\\/]?//; } if ($ENV{'GATEWAY_INTERFACE'}) { print "- ${tagbr}${tagbold}Did you use the correct URL ?${tagunbold}${tagbr}\n"; print "Example: http://localhost/awstats/awstats.pl?config=mysite${tagbr}\n"; @@ -1280,10 +1282,9 @@ sub Parse_Config { #------------------------------------------------------------------------------ sub Read_Ref_Data { # Check lib files in common possible directories : - # Windows : "${DIR}lib" (lib in same dir than awstats.pl) + # Windows and standard package: "$DIR/lib" (lib in same dir than awstats.pl) # Debian package : "/usr/share/awstats/lib" - # Other possible directories : "./lib" - my @PossibleLibDir=("${DIR}lib","/usr/share/awstats/lib","./lib"); + my @PossibleLibDir=("$DIR/lib","/usr/share/awstats/lib"); my %FilePath=(); my %DirAddedInINC=(); my @FileListToLoad=(); while (my $file=shift) { push @FileListToLoad, "$file.pm"; } @@ -1329,10 +1330,9 @@ sub Read_Ref_Data { #------------------------------------------------------------------------------ sub Read_Language_Data { # Check lang files in common possible directories : - # Windows : "${DIR}lang" (lang in same dir than awstats.pl) + # Windows and standard package: "$DIR/lang" (lang in same dir than awstats.pl) # Debian package : "/usr/share/awstats/lang" - # Other possible directories : "./lang" - my @PossibleLangDir=("$DirLang","${DIR}lang","/usr/share/awstats/lang","./lang"); + my @PossibleLangDir=("$DirLang","$DIR/lang","/usr/share/awstats/lang"); my $FileLang=''; foreach (@PossibleLangDir) { @@ -1747,11 +1747,10 @@ sub CheckSum { #------------------------------------------------------------------------------ sub Read_Plugins { # Check plugin files in common possible directories : - # Windows : "${DIR}plugins" (plugins in same dir than awstats.pl) + # Windows and standard package: "$DIR/plugins" (plugins in same dir than awstats.pl) # Redhat : "/usr/local/awstats/wwwroot/cgi-bin/plugins" # Debian package : "/usr/share/awstats/plugins" - # Other possible directories : "./plugins" - my @PossiblePluginsDir=("${DIR}plugins","./plugins","/usr/local/awstats/wwwroot/cgi-bin/plugins","/usr/share/awstats/plugins"); + my @PossiblePluginsDir=("$DIR/plugins","/usr/local/awstats/wwwroot/cgi-bin/plugins","/usr/share/awstats/plugins"); my %DirAddedInINC=(); foreach my $key (keys %NoLoadPlugin) { if ($NoLoadPlugin{$key} < 0) { push @PluginsToLoad, $key; } } @@ -4991,7 +4990,7 @@ sub ShowEmailReceiversChart { #------------------------------------------------------------------------------ # MAIN #------------------------------------------------------------------------------ -($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; +($DIR=$0||'.') =~ s/[\/\\]([^\/\\]+)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1; $starttime=time(); @@ -5172,6 +5171,7 @@ else { $DayRequired=''; } if ($Debug) { if ($ENV{'GATEWAY_INTERFACE'}) { print "\n"; } # To end the HTTP header and see all debug debug(ucfirst($PROG)." - $VERSION - Perl $^X $]",1); + debug("DIR=$DIR PROG=$PROG",2); debug("QUERY_STRING=$QueryString",2); debug("HTMLOutput=".join(',',keys %HTMLOutput),1); debug("YearRequired=$YearRequired, MonthRequired=$MonthRequired",2);