Problem with awstats-7.0 from ISPConfig-2.2.38

Discussion in 'General' started by brt, Apr 28, 2011.

  1. brt

    brt New Member

    Hi,

    the links on the generated overview-pages eg. awstats.www.mydomain.com.2011-04.html are broken, they point to eg. www.mydomain.com.2011-04.allhosts.html instead of awstats.www.mydomain.com.2011-04.allhosts.html.


    i was able to "workaround" the problem by changing the symbolic link in the ispconfig/tools-directory back to awstats-6.9.

    after this the pages were build with correct links again.

    is there something wrong with the configuration or is this a known bug?


    ------


    i also noticed some errors about mkdir trying to crate directories, when executing /root/ispconfig/scripts/shell/awstats.php
    i changed:


    PHP:
                        if (!@is_file($stats_path))
    to:


    PHP:
                        if (!@is_dir($stats_path))
    now the errors are gone
     
  2. jnsc

    jnsc rotaredoM

    Thanks for your report.

    I also noticed the link problem, but I didn't have the time to look at it. But it looks like that it's a AWStats 7 bug. For the 2 problem, I was certain that I already fixed it in SVN, but I will have to check that also.

    Regards
     
  3. jlaughy

    jlaughy New Member

  4. JohnMH

    JohnMH New Member

    Any ideas on fixing awstats?
     
  5. brt

    brt New Member

    awstats in ISPConfig 2.2.39

    just installed ISPConfig 2.2.39 and noticed that no detail pages were generated at all!

    after some investigation i found out that i had to add some lines to /etc/awstats/awstats.shared.conf :
    Code:
    ShowSummary=UVPHB
    ShowMonthStats=UVPHB
    ShowDaysOfMonthStats=VPHB
    ShowDaysOfWeekStats=PHB
    ShowHoursStats=PHB
    ShowDomainsStats=PHB
    ShowHostsStats=PHBL
    ShowRobotsStats=HBL
    ShowSessionsStats=1
    ShowPagesStats=PBEX
    ShowFileTypesStats=HB
    ShowOSStats=1
    ShowBrowsersStats=1
    ShowOriginStats=PH
    ShowKeyphrasesStats=1
    ShowKeywordsStats=1
    ShowMiscStats=a
    ShowHTTPErrorsStats=1
    
    after adding this, detail pages were generated again :)
    but the links on the mainpage are still leading to a 404 :(

    this is how i fixed it:

    in /home/admispconfig/ispconfig/tools/awstats/tools/awstats_buildstaticpages.pl:
    change the following line #451:
    Code:
    # Launch all other awstats output
    .
    .
    .
       $OutputFile=($OutputDir?$OutputDir:"")."[COLOR="Red"]awstats.[/COLOR]$OutputSuffix.$output.$StaticExt";
    
    to:

    Code:
    # Launch all other awstats output
    .
    .
    .
    #  $OutputFile=($OutputDir?$OutputDir:"")."[COLOR="red"]awstats.[/COLOR]$OutputSuffix.$output.$StaticExt";
       $OutputFile=($OutputDir?$OutputDir:"")."$OutputSuffix.$output.$StaticExt";
    
    take care to change only the line in section "Launch all other awstats output" but DO NOT CHANGE section "Launch main awstats output"

    and voila, everything is working again :D
     
    Last edited: Jun 7, 2011
  6. brt

    brt New Member

    it seems it is still not fixed in 2.2.39, in /root/ispconfig/scripts/shell/awstats.php on line 93:

    Code:
                        if (!@[COLOR="Red"]is_file[/COLOR]($stats_path))
    
    instead of

    Code:
                        if (!@[COLOR="SeaGreen"]is_dir[/COLOR]($stats_path))
    


    also a bit strange on line 226:

    Code:
                            [COLOR="Red"]if (!@is_dir("$stats_path/index.html"))[/COLOR]
    
    
    *edit*

    "$stats_path/index.html" will never be a directory, so this condition does not make any sense at all, the code included in this condition will always be executed. well thats not a bad thing but the condition could just be ommited.

    what would make sense would be to check if there is no index.html file or if the file does not contain a link to the current month, this could be like this:

    Code:
    if (!is_file("$stats_path/index.html") || (!preg_match("/awstats.$web_real_name.$year-$month.html/",file_get_contents("$stats_path/index.html")))) {
    
     
    Last edited: Jun 8, 2011

Share This Page