missing webalizer stats

Discussion in 'Installation/Configuration' started by bolero, Jul 22, 2008.

  1. bolero

    bolero New Member

    I think I have hosed the creation of webalizer stats on my new setups somehow. I have a test setup where stats are getting created in a stats subdirectory for the webids and in a usage directory for the main hostname. e.g. it seems to work. Because webalizer stats where in English (I need them in German) I followed the directions elsewhere in this forum and compiled a new webalizer. As version 2.20 had just come out I used that. It seems to work. At least I get an answer that makes sense when I just run "webalizer".
    However, it's not getting used by ISPConfig although a "which webalizer" tells me the system wants to use 2.20 in /usr/local/bin and not 2.10 in /usr/bin. According to the forum post a newly compiled one should just work "if it is in the path". webalizer.php uses "which webalizer" itself. But if the path for the command is different it would not find it. From where does ISPConfig get the path? A cron script? There is no cron script for it in cron.daily, although it runs at 4:00 a.m. which looks very much like cron.daily. There's only 00webalizer which can't be it.
    I cloned that setup and uninstalled the webalizer rpm, so that only that new webalizer binary is there. On that setup I don't get any stats at all, not even the stats directories got created. I assume there's either the cron/schedule file missing or it doesn't find the binary.
    How can I troubleshoot this?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You compiled your webalizer with the wrong path. You should have used the same path then the webalizer that was already installed on your system.

    To correct this without recompiling you should rename the webalizer binray from your system, so the which cammand finds your newly compiled version.
     
  3. bolero

    bolero New Member

    Thanks for the very quick answer. I just compiled it with default target path, that's apparently /usr/local. Anyway, that can't be it. As I explained, I cloned the VM and removed the webalizer rpm. There is no /usr/bin/webalizer anymore, only /usr/local/bin/webalizer.
    As I wrote, either the scheduled creation got accidently hosed, so that webalizer.php (which seems to be responsible for stats creation) doesn't run at all or the which run from it can't find the webalizer in the /usr/local/path. At least I see only these two options. I will try an ln -s to overcome the which problem.
    How can I check this? What actually triggers the nightly webalizer runs at 4 am? And can I mimick that now so that I can test creating stats at any time?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, either you recompile webalizer so that it is located in /usr/bin/webalizer or you symlink it.
     
  5. bolero

    bolero New Member

    Yes, I already did the latter a few minutes ago. But is there no way to test it *now*? I just checked the individual crontabs and there is one that runs webalizer.php. So I now know how this is triggered. Can I just run it now or would this spoil something?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Yes, you can run that cron job manually. If it doesn't display any errors, everything should be fine.
     
  7. bolero

    bolero New Member

    Ok, it seems to be running at night, but no output. I ran it now from the shell and here's sample output for one web:

    Code:
    Fehler: Kann die Protokolldatei nicht ¦ffnen. /var/www/web1/log/web.log (symlink)
    
    Erstelle Statistik Verzeichnis: /var/www/web1/web/stats
    
    Domain: example.de
    Log Dir: /var/www/web1/log
    Max Log size: 157286400
    Current Log size: 23776
    
    Code:
    l /var/www/web1/log/web.log
    lrwxrwxrwx 1 web1admin web1 47 Jul 22 23:38 /var/www/web1/log/web.log -> /var/www/www.example.de/log/2008/07/web.log
    
    l /var/www/www.example.de/log/2008/07/web.log -rw-r--r-- 1 web1admin web1 21227 Jul 24 00:30 /var/www/www.example.de/log/2008/07/web.log
    
    l /var/www/web1/web/stats
    total 12
    drwxr-xr-x 2 web1admin web1 4096 Jul 24 19:40 .
    drwxrwxr-x 5 web1admin web1 4096 Jul 24 19:40 ..
    -rw-rw-r-- 1 web1admin web1  124 Jul 24 19:40 .htaccess
    
    Log has only hits from yesterday, I don't know if that should generate stats.

    But the errors don't look good. First it can't find the log file, but then it knows the size (not exactly correct, though)?

    What's going on here? On another setup I see that it happens for all logs that are not empty! Could it be the wrong log format? Which log format do we need? Did I overlook something in your setup guide for CentOS 5? (I don't remember anything about log formats.)
     
  8. bolero

    bolero New Member

    Ok, getting nearer. Changing to the default English webalizer produces stats. That is webalizer 2.01. Either webalizer 2.02 doesn't like the log format in general or it doesn't like the log format definition it gets from webalizer.php (I assume the command includes expected logfile format?) or I need to compile it with some specific option. Ideas?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The log file is processed once a night. so thats ok. and the log size is fine too. I guess that your webalizer binary does not generate the correct statistics, as the ouput from the manual run of the webalizer.php is fine.

    Have you run your webalizer binary manually and does it produce correct stats for the file /var/www/web1/log/web.log ?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Have a look inside the webalizer.php file for the options that ispconfig uses. the options which are used there work for all webalizer packages for all supported linux distributions, so I guess you might have used wrong compile options for your custom webalizer binary.
     
  11. bolero

    bolero New Member

    I compiled with these configure options:

    ./configure --with-language=german --enable-dns --enable-geoip --with-geodb=/var/lib/GeoIP

    and webalizer on CentOS 5.2 has this configure line:

    %configure --enable-dns --with-dblib=/lib

    Doesn't look like anything of that should affect the logformat handling. There were 15 patches applied, but none seem to apply either.
    Patch1: dns-db1.patch
    Patch2: webalizer-2.01_10-lfs.patch
    Patch3: webalizer-2.01-10-overflow.patch
    Patch4: webalizer-2.01-10-underrun.patch
    Patch5: webalizer-2.01-10-ipv6.patch
    Patch6: webalizer-2.01_10-confuser.patch
    Patch7: webalizer-2.01-10-hostname.patch
    Patch8: webalizer-2.01-10-maxagent.patch
    Patch9: webalizer-2.01-10-groupvisit.patch
    Patch10: webalizer-2.01-10-countrycode.patch
    Patch11: webalizer-2.01-10-agent-opera.patch
    Patch12: webalizer-2.01-10-agent-gecko.patch
    Patch13: webalizer-2.01-10-agent-apple.patch
    Patch14: webalizer-2.01-10-agent-compatible.patch
    Patch15: webalizer-2.01-10-agent-default.patch
     
    Last edited: Jul 24, 2008
  12. bolero

    bolero New Member

    I found the reason. It's not the logfile content, it's indeed what the first line suggests, it can't follow the symlink. Weird.
     
  13. bolero

    bolero New Member

    Code:
     o Added symbolic link checks for file I/O to prevent possible
       privilege escalation exploits.  Disallows reading from or writing
       to any file that is a symlink.  Thanks to Julien Danjou.
    
    Great. This will hit many people in the future.
     
  14. bplgonzo

    bplgonzo New Member

    I did this also. i compiled webalizer 2.2 with default path /usr/local/bin/webalizer
    'which webalizer' now returns /usr/local/bin/webalizer

    Whatever i try, path stays /usr/local/bin/webalizer

    I tried apt-get remove webalizer but I guess it only remove 2.01 version
    I tried to recompile webalizer with --prefix=/usr/bin but 'which webalizer' still returns /usr/local/bin/webalizer


    here is what I get when I run Webalizer manually (domain names replaced with xxxxxxx.net):

    www:~# /root/ispconfig/php/php -q /root/ispconfig/scripts/shell/webalizer.php
    Error: Can't open log file /var/www/web1/log/web.log (symlink)
    Error: Can't open log file /var/www/web19/log/web.log (symlink)
    Error: Can't open log file /var/www/web18/log/web.log (symlink)
    Error: Can't open log file /var/www/web21/log/web.log (symlink)
    Error: Can't open log file /var/www/web6/log/web.log (symlink)
    Error: Can't open log file /var/www/web22/log/web.log (symlink)


    Domain: xxxxxxx.net
    Log Dir: /var/www/web1/log
    Max Log size: 15728640000
    Current Log size: 12999005596
    Domain: xxxxxxx.net
    Log Dir: /var/www/web18/log
    Max Log size: 31457280000
    Current Log size: 79087581
    Domain: xxxxxxx.net
    Log Dir: /var/www/web19/log
    Max Log size: 3145728000
    Current Log size: 89201961
    Domain: xxxxxxx.net
    Log Dir: /var/www/web7/log
    Max Log size: 31457280000
    Current Log size: 3272915
    Domain: xxxxxxx.net
    Log Dir: /var/www/web6/log
    Max Log size: 62914560000
    Current Log size: 8572937204
    Domain: xxxxxxx.net
    Log Dir: /var/www/web8/log
    Max Log size: 31457280
    Current Log size: 0
    Domain: xxxxxxx.net
    Log Dir: /var/www/web21/log
    Max Log size: 15728640000
    Current Log size: 152756092
    Domain: xxxxxxx.net
    Log Dir: /var/www/web22/log
    Max Log size: 31457280000
    Current Log size: 468181120

    i don't know what to do and how to enable new webalizer 2.2 to work with ISPConfig

    Any help?
     
  15. bolero

    bolero New Member

    You should read whole threads before answering or trying out anything. The last posting I made clearly states the reason for your problem. You have to edit the source code of webalizer so that it allows following of symbolic links again. Not difficult, but you have to know what you do.
     
  16. bplgonzo

    bplgonzo New Member

    Yes, i did read whole thread, but you did not leave any answer for those who don't know how to do that, like me.
    So i had to ask someone to tell me what to do.
     

Share This Page