Webalizer doesn't work :(

Discussion in 'Installation/Configuration' started by DarkBen, Oct 14, 2005.

  1. DarkBen

    DarkBen New Member

    Hi,
    i use ISPconfig on a debian SARGE (your work is great :) ). I use the The Perfect Setup - Debian Sarge (3.1) tutorial and the system is ok but Webalizer doesn't start. When i launch manually "/usr/bin/webalizer", i have an error "Error: Can't open log file /var/log/apache/access.log.1". I have Apache2 on my server and this error seems to be logical :). When i create a new site on ISPConfig, the stats directory isn't created. The howto :

    apt-get install webalizer

    <- /var/www/webalizer
    <- Usage Statistics for
    <- /var/log/apache/access.log.1

    Could you explain to me what is the good conf ?

    Webalizer seems to be correctly installed (i have /usr/bin/webalizer and /etc/webalizer.conf)

    Could you help please ?

    Excuse me for my poor english ;)

    Thanks a lot for your work !
     
  2. till

    till Super Moderator

    This seems to be OK, there is no error or problem.

    1) The stats directory is created automatically by a cronjob every morning between 1 - 3 AM right before webalizer is started.
    2) You cant run webalizer by starting the webalizer binary without providing additional configuration files. ISPConfig provides the nescessary configuration automatically as commanfdline arguments when it starts webalizer.

    Just wait a bit and tomorrow morning you will have your webalizer stats :)
     
  3. DarkBen

    DarkBen New Member

    Thanks for your answer, but i have created 5 sites (the first site was created tuesday 11) and there is no stat :(
    The stats directories are not created by the program. Can i manually test the cronjob ?

    PS : the firewall is activated (In ISPConfig) ... The firewall can be the problem ?

    Tanks for your help :)
     
  4. DarkBen

    DarkBen New Member

    I watch my syslog file :

    grep -i cron syslog.1

    I gave you only the parts from the time interval where stats must be done

    Code:
    Oct 13 00:09:01 leretour /USR/SBIN/CRON[393]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 00:17:01 leretour /USR/SBIN/CRON[518]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 00:39:01 leretour /USR/SBIN/CRON[885]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 01:09:01 leretour /USR/SBIN/CRON[1594]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 01:17:01 leretour /USR/SBIN/CRON[1728]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 01:39:01 leretour /USR/SBIN/CRON[2081]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 02:09:01 leretour /USR/SBIN/CRON[2846]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 02:17:01 leretour /USR/SBIN/CRON[2969]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 02:39:01 leretour /USR/SBIN/CRON[3341]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 03:09:01 leretour /USR/SBIN/CRON[3925]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 03:17:01 leretour /USR/SBIN/CRON[4047]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 03:39:01 leretour /USR/SBIN/CRON[4635]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 04:09:01 leretour /USR/SBIN/CRON[5482]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 04:17:01 leretour /USR/SBIN/CRON[5603]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 04:39:01 leretour /USR/SBIN/CRON[5986]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 05:09:01 leretour /USR/SBIN/CRON[6467]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 05:17:01 leretour /USR/SBIN/CRON[6591]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 05:39:01 leretour /USR/SBIN/CRON[7031]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 06:09:01 leretour /USR/SBIN/CRON[7912]: (root) CMD (  [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxlifetime) -print0 | xargs -r -0 rm)
    Oct 13 06:17:01 leretour /USR/SBIN/CRON[8136]: (root) CMD (   run-parts --report /etc/cron.hourly)
    Oct 13 06:25:01 leretour /USR/SBIN/CRON[8250]: (root) CMD (test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily)
    This is my crontab file in /var/spool/cron/crontabs

    root

    Code:
    30 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php &> /dev/null
    59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/ftp_logs.php &> /dev/null
    59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php &> /dev/null
    59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/cleanup.php &> /dev/null
    0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php &> /dev/null
    0,30 * * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/check_services.php &> /dev/null
    15 3,15 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/quota_msg.php &> /dev/null
    40 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/traffic.php &> /dev/null

    I hope that help you...

    hanks for your help
     
  5. falko

    falko Super Moderator

  6. raveneye

    raveneye New Member

    I had the same issue, also on Debian Sarge. I thought webalizer was correctly installed, but somewhere in all my fiddling with packages it got removed somehow.

    Check if `which webalizer` returns a value. maybe it can't be found, then the script (/root/ispconfig/scripts/shell/webalizer.php) is aborted.

    hope I could be of any help

    Bram
     
    Last edited: Oct 14, 2005
  7. DarkBen

    DarkBen New Member

    Thanks Raveneye but "which webalizer" returns the good path of webalizer binary program. I have restarted cron on /etc/init.d like Falko said.

    It seems that i need to wait for this night new execution of the scripts...
     
  8. DarkBen

    DarkBen New Member

    This is ok now ! The stats have been created during the week end :D
    I have stoped cron process

    Code:
    /etc/init.d/cron stop 
    and killed all cron PID.

    Code:
    pkill cron
    I have edited the crontab :

    Code:
    cd /var/spool/cron/crontabs/
    
    crontab -e
    
    /etc/init.d/cron start
    As it was explained (http://www.howtoforge.com/forums/showpost.php?p=3227&postcount=8) i have restarted cron process

    Code:
    /etc/init.d/cron start
    and the stats are well done now :)

    Thanks a lot for your help ;)
     
  9. bingnet

    bingnet New Member

    I am running the ISPconfig Virtual Appliance from the VMware VMTN repository. The webalizer stats were not generated automatically, and although 'which webalizer' shows it is installed, and other cron jobs are executing properly, there is still not a www.example.com/stats/ website or any log activity in /var/log/syslog.

    Thank you for any help,
    Ken
     
  10. till

    till Super Moderator

    Please do the steps that darkben suggested.
     
  11. bingnet

    bingnet New Member

    Hello,

    I tried the steps that were referred to in this thread, waited five days, and didn't realize I needed to wait a week. The stats were available after seven days. Can I have mail logs included in the webalizer stats? I was really looking for email use analysis.

    Thanks,
    Ken
     
  12. till

    till Super Moderator

    No, Mail logs can not be included in this stats-
     
  13. jtwyrrpirate

    jtwyrrpirate New Member

    no /var/log/apache2/access.log.1 file???

    After following the perfect setup howto for debian etch, I logged into www.domainname.com/stats/ and got a 403 - Forbidden! error. I've tried:
    All the suggestions on this thread
    Reinstalling webalizer
    dpkg-reconfigure webalizer
    waiting (the server has been running for about a week now)
    lots of googling!
    And nothing seems to get it working. Webalizer is working and produces this output when run manually:

    Using logfile /var/log/apache2/access.log (clf)
    Using default GeoIP database
    Creating output in /var/www/webalizer
    Hostname for reports is 'server1.domainname.com'
    Reading history file... webalizer.hist
    Generating report for April 2007
    Generating summary report
    Saving history information...
    12 records in 0.02 seconds

    Note that rather than the default /var/log/apache2/access.log.1, I'm using /var/log/apache2/access.log. This is because there is no /var/log/apache2/access.log.1 to be found on the server.

    I've got an identical setup on a different machine and stats work fine there (on that machine there IS a /var/log/apache2/access.log.1).

    Any ideas?
     
  14. till

    till Super Moderator

    First, ISPConfig does not use the logfiles /var/log/apache2/access.log.1, I'm using /var/log/apache2/access.log.

    - Does the web.log file in the log directory of the website contains current log lines from the last day?
    - Is there a stats directory within the website that contains some html files or is the stats directory missing?
     
  15. jtwyrrpirate

    jtwyrrpirate New Member

    Thanks for the relpy, to answer your questions:

    The log directory for the website contains only error.log, no web.log or any other files.

    There is a stats directory for the website, however it is empty.
     
  16. falko

    falko Super Moderator

    Has the web site been accessed the day before? Because if it hasn't, then no logs are created.
     
  17. jtwyrrpirate

    jtwyrrpirate New Member

    yes, the site was accessed the day before

    I decided to do a clean install, webalizer is again not working. It gives this message when run manually:

    Webalizer V2.01-10 (Linux 2.6.18-4-686) locale: en_US.UTF-8
    Error: Can't open log file /var/log/apache2/access.log.1

    The only difference between this machine and another that I have with the same setup (which runs flawlessly, including webalizer) is the machine that's giving me trouble has a separate partition for /home ...can this affect webalizer?

    Ah, just remembered one more thing that's customized on the machine that's giving me trouble...
    I've commented out the two lines that begin with "AliasMatch" from /root/ispconfig/isp/conf/vhost.conf.master to prevent users from being able to publish www content in their individual web directories. Not sure if this would affect webalizer, but I'm trying to give you as much to go on as I can.

    Thanks for your help so far
     
    Last edited: May 6, 2007
  18. jtwyrrpirate

    jtwyrrpirate New Member

    Fixed it!

    Ok I guess the clean install fixed it...perhaps something got muddled the first time I installed it. I appreciate the input, guys, keep up the great work!
     
  19. chancer

    chancer New Member

    So I have a cron job running daily at 4 a.m:

    Code:
    0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php &> /dev/null
    What do I run to get my stats? e.g. https://www.mysite.com:81/webalizer or something else?

    Also, what does the &> /dev/null mean?
     
    Last edited: Jan 13, 2008
  20. tensor

    tensor New Member

    It means that the ALL output from the script is sent to /dev/null which is a special file (device, actually). /dev/null just eats whatever you sent it whithout doing anything else.
     

Share This Page