AWStats Installer

Discussion in 'Tips/Tricks/Mods' started by jnsc, Oct 6, 2006.

  1. jnsc

    jnsc rotaredoM Moderator

    It looks like as if the alias part was missing, check your httpd.conf or apache2.conf
    and look if you have this line
    Code:
    Alias /icon "/home/admispconfig/ispconfig/tools/awstats/wwwroot/icon/"
    And yes if you could send me the diff, I will have a look at It. Maybe when we have recieved a little bit more feedback about this installer we could try to include it in the dev branche of ISPConfig, if Till and Falko agree.

    Regards
     
  2. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    That would be great. :)
     
  3. boatrsp

    boatrsp New Member

    Checked that, and indeed it was missing. Must have overseen that after modifying the script. I inserted it manually and restarted apache, but the bars still don't show up... If I try to view the image of a bar, I get a 403 Forbidden error!

    I inserted a Directory stance for /home/amdispconfig... in httpd.conf, but this didn't help.

    I propose to send you the diff when everything works fine ;)
     
  4. jnsc

    jnsc rotaredoM Moderator

    Do you have something in your httpd error log? And can you check the permissions of the /home/admispconfig/ispconfig/tools/awstats-6.5 normally it should be admispconfig:admispconfig
     
  5. jnsc

    jnsc rotaredoM Moderator

    I just released a new version of the installer which now handle multi language, and also co-domains.

    As always comments are welcome.
     
  6. boatrsp

    boatrsp New Member

    Nothing in the logs :(

    The ownership of the awstats-6.5 directory, and everything underneath, was indeed incorrect. But after changing it to admispconfig.admispconfig the 403 forbidden still bugs me...
     
  7. jnsc

    jnsc rotaredoM Moderator

    This is strange, if you get a 403 it should be logged somewhere. Did you chek both the error log file and the access log file?

    And what are the permissions for the directory /home/admispconfig/ispconfig/tools/awstats-6.5, try
    Code:
    chmod 755 /home/admispconfig/ispconfig/tools/awstats-6.5/
     
  8. boatrsp

    boatrsp New Member

    I actually should have specified there was nothing in the error_log. And just the laconic messages like this one in the access_log:

    xxx.xxx.xxx.xxx - - [27/Oct/2006:16:53:44 +0200] "GET /icon/browser/netscape.pngHTTP/1.1" 403 453 "http://www.xyz.tld/awstats/awstats.www.xyz.tld.2006-10.html"

    No, these were ok.
     
  9. boatrsp

    boatrsp New Member

    Neat! :)
    What should I do to re-install the new version? I guess removing all the awstats subdirs, the .htpasswd files would be part of the picture?
     
  10. jnsc

    jnsc rotaredoM Moderator

    Just replace
    Code:
    /root/ispconfig/scripts/shell/awstats.php
    with the new one, and remove all config file for the domains
    Code:
    /etc/awstats/awstats.www.mydomain.com.conf
    but do not remove
    Code:
    /etc/awstats/awstats.shared.conf
    or you will have to copy it manually.
     
  11. jnsc

    jnsc rotaredoM Moderator

    For your problem in wich log did you check?

    In /var/log/apache2/error.log (the path may vary form one distribution to another) or did you check in the log of your domain /home/www/webX/log/error.log?
     
  12. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    Bugs

    Besides my apache not being installed in /etc/apache but in redhats default /etc/httpd/conf/httpd.conf which you could make a simple test if either exists or use httpd -V to find it I found other issues.

    1. /root/ispconfig/scripts/shell/awstats.php (Added double backslash to $file href)
    PHP:
    <?php
    \$dir = \".\";

    if( \$dh = opendir(\$dir)) {
            while ((\$file = readdir(\$dh)) !== false) {
                    \$pattern = 'awstats\..*\.[0-9]{4}-[0-9]{2}\.html';
                    if (ereg(\$pattern, \$file)) {
                            echo \"<a href=\\"
    \$file\">\$file</a><br />\";
                    }
            }
    }
    # Arrgh forum is stripping my slashes.. 
    # should be href= bsl bsl " 
    $file bsl bsl "
    ?>
    2. remember that this create multiple set of files (over night it was 248KB for 1 day), this will grow unlike the awstats mod I did which uses the DB lookup to any date/month/year dynamically. These files are owned by the admin user so the quotas apply.

    At least the installer quite well done besides the apache problem I had.. still gotta get time to get mine done.
     
    Last edited: Oct 29, 2006
  13. jnsc

    jnsc rotaredoM Moderator

    Thank's for you comments, I will have a look at your suggestions when I have a little bit more time.
     
  14. rene.kirkegaard

    rene.kirkegaard New Member

    Help Please

    I just installed your script followed all the instructions on your website, but I have a problem with it.

    When my server made the Awstas dir. it creates a bunch of files, and an Index.php file. (20 stats files)

    When I try to enter the Awstas directory, i get this error.

    Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /var/www/web9/web/awstats/index.php on line 11


    And heres the php file :

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <body>
    <?php
    $dir = ".";

    if( $dh = opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
    $pattern = 'awstats\..*\.[0-9]{4}-[0-9]{2}\.html';
    if (ereg($pattern, $file)) {
    echo "<a href="$file">$file</a><br />";
    }
    }
    }
    ?>
    </body>
    </html>


    Anyone who can help me out ??
     
  15. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    Read my post above. the line is missing a back slash and I got the same error.

    You need to add another back slash to the slashes around the $file word in the "echo" statement.

    I tried to put my example fix but this forum keeps stripping my slashes.
     
  16. rene.kirkegaard

    rene.kirkegaard New Member

    Did that and get this error now :

    Parse error: parse error, unexpected T_VARIABLE in /var/www/web9/web/awstats/index.php on line 11
     
  17. jnsc

    jnsc rotaredoM Moderator

    As djtremors told you, you have to change the /root/ispconfig/scripts/shell/awstats.php file not the index.php. After that you have to remove your index.php file and run
    Code:
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/awstats.php
    that will regenerate your index.php file
     
  18. jnsc

    jnsc rotaredoM Moderator

    I updated the installer just do the following steps :

    Code:
    wget http://jnsc.ch/downloads/ISPConfig_awstats_pkg_alpha-5.tar.gz
    Code:
     tar -xvzf ISPConfig_awstats_pkg_alpha-5.tar.gz
    Code:
    cd ISPConfig_awstats_pkg
    Code:
    cp awstats.php /root/ispconfig/scripts/shell/awstats.php
    Code:
    rm /home/www/web9/web/awstats/index.php
    Code:
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/awstats.php
     
    Last edited: Dec 2, 2008
  19. domino

    domino New Member

    I never got a chance to thank you for this. Soooo.. Thanks!! The update went well. Can you please post a changelog in future versions?

    thank you
     
  20. jnsc

    jnsc rotaredoM Moderator

    Yes, a changelog would be a good idea. Thank's for this sugestion.
     

Share This Page