Webalizer issues

BadSpeed

Verified User
Joined
Nov 20, 2004
Messages
30
I don't know why but webalizer doesn't want to do his job.

Here is a little description of my server :
Currently behind a firewall that forward port on local IPs.
Pmods.net, which is the mail domain is binded on 204.180.195.42 but actually it is on a server which has for IP : 192.168.3.4
Everything works correctly, DA related (apache, ftp, mail etc)
I have modified the httpd.conf in order to have them listen the private IP and not 204.180.195.42 in order to have subdomains and different seccondary domains.
When using the command line for the shell, no error are return (I found an example of what to type in the shell on DA forum)


Where are the cfg file for webalizer maybe I'll find some clues on why it doesn't work ...
 
This is where I looked ... but I don't have any webalizer.conf in /etc :S
 
You'll probably see a /etc/webalizer.conf.moved. This in fact is created by directadmin if it finds the /etc/webalizer.conf

IOW, DA works on Webalizer defaults by default.

You can override some parameters by using creating webalizer.conf in the custom templates folder:
http://help.directadmin.com/item.php?id=27

I believe, DA does not support tokens for this template, though. So we can't use user/domain specific parameters in this conf file (for instance, to hide self referers). Input Logs and Output files are passed by DA to webalizer via arguments.

I believe, the trigger to make DA run webalizer is:
Code:
echo "action=tally&value=all" >> /usr/local/directadmin/data/task.queue
This is done by /etc/cron.d/directadmin_cron (at 00:10h, at my end). But you can do it your self, if you wish.

More on how the DA task queue works here:
http://www.directadmin.com/technotes.html

PS: I have learnt a bit while writing this post. :D
 
Ok,
if I understant what you are saying, me not having an webalizer.conf is normal (in /etc) ... and I don't have webalizer.conf.moved also.

So why Webalizer won't do its job !? if everything is ok.
Is it because of my firewall that translate 204.180.195.42 into 192.168.3.4 ?
 
I don't know. :confused:

However, I've got an idea that it might make DA run webalizer with a custom webalizer.conf, tokens enabled (well, at least the user and domain tokens). :eek:

I've done the following:

Code:
# cd /usr/bin
# mv webalizer webalizer-orig
# touch webalizer
# chmod 755 webalizer
# vi webalizer
i
#! /bin/bash
echo $* > /tmp/webalizer_args
/usr/bin/webalizer-orig $*
:x
Then, to see what happens I requested DA to do its job by
Code:
echo "action=tally&value=all" >> /usr/local/directadmin/data/task.queue
After a minute (or so), I went to see the contents of the file /tmp/webalizer_args, which was as follows:
Code:
/usr/bin/webalizer -p -n |DOMAIN| -o /home/|USER|/domains/|DOMAIN|/stats /var/log/httpd/domains/|DOMAIN|.log
...well, |USER| and |DOMAIN| where the values, not the tokens.


So, knowing how DA invokes webalizer it is possible to extend the new webalizer script to build a custom webalizer.conf file by parsing the arguments on the fly, then running the "real" one, which is now webalizer-orig.

I'm going to try this... :)


PS: Well, if you need to use your own customized webalizer.conf to deal with your configuration, it might help. I'm also happy, since with such a custom .conf it will be possible to filter self-referers, making the stats more interesting...
 
Here we go:
Code:
#! /bin/bash

# As of v 1.23.3 DirectAdmin calls this script as follows:
# webalizer -p \
#	-n |DOMAIN| \
#	-o /home/|USER|/domains/|DOMAIN|/stats  \
#	/var/log/httpd/domains/|DOMAIN|.log
#
# which we get from $* and pass on to the "real worker".
#
# Then, we just add (override) our own parameters.
#
DA_ARGS="$*"

#
# Get the domain name from the command line...
#
DOMAIN=""
while [ $# -ge 1 ]; do
	if [ "$1" = "-n" ]; then
		shift
		DOMAIN="$1"
	fi
	shift
done
if [ "$DOMAIN" = "" ]; then
        DOMAIN=`hostname`
fi

#
# Create a temporary configuration file...
#
TMP_CONF_FILE="/tmp/webalizer.$DOMAIN"

cat > $TMP_CONF_FILE <<END_OF_TEXT
AllAgents       'yes'
AllReferrers    'yes'
TopKSites       20
AllSites        'yes'
TopKURLs        20
AllURLs         'yes'
TopSearch       20
AllSearchStr    'yes'
TopUsers        0
IgnoreSite      *$DOMAIN
IgnoreReferrer  *$DOMAIN/*
END_OF_TEXT

#
# Launch the 'real' webalizer. Please, check out the webalizer's README ;-)
#
/usr/bin/webalizer-orig \
	-c $TMP_CONF_FILE \
	-r "*$DOMAIN/" \
	-s "*$DOMAIN" \
	-P 'htm*' -P 'cgi' -P 'txt' -P '*html' -P 'php*' -P 'asp' -P 'pl' \
	-u *.gif -u *.GIF -u *.jpg -u *.JPG -u *.png -u *.PNG -u *.ra \
	-A 30 -C 30 -R 30 -S 30 -U 30 -e 10 -E 10 \
	-D /var/cache/dns_cache.db -N 10 \
	$DA_ARGS

#
# Remove the temporary configuration file...
#
if [ -f $TMP_CONF_FILE ]; then
	rm -f $TMP_CONF_FILE
fi


Oh well, I don't know if that may help you.
 
Last edited:
Thx for your help ...
but I have try to execute manualy webalizer ... and it isn't working
here is what I have executed in SSH :
/usr/bin/webalizer -p -n pmods.net -o /home/pmods/domains/pmods.net/stats /var/log/httpd/domains/pmods.net.log
 
...and? ...what's the result?

Is this because your log files contain references to the local IP and it should be the public one?
 
The thing is that I don't have any result
Webalizer doesn't say : "Sorry I don't want to work" or any error message
And if I go in the stat directory I don't see any file :s

My guess is because we see the local IP on the log and not the internet one ... but I'm not even sure :s
 
...or maybe your webalizer.hist and/or webalizer.current files are corrupted?

/home/pmods/domains/pmods.net/stats/webalizer.current
/home/pmods/domains/pmods.net/stats/webalizer.hist

format is explained in the README. the webalizer.current contains a timestamp which is compared with the log records to make incremental updates.
 
Nothing new with the -d
And I don't have any file in the stats, so no webalizer.current or webalizer.hist

:S
 
Weird. Do you have data in the logs? :lol:

I have no idea what's going on... :confused:


I have updated my previous post with a more enhanced version of the script. It now parses the command line to get the DOMAIN and it builds a .conf on the fly. Total control in just one single place. :)
 
I do have datas in my logs files ...
anyway thx for your help :)

I'm gonna mail DA ;)
 
I have the same problem. I checked the webalizer binary at /usr/sbin/webalizer and I found out that is has a size of zero bytes.

Now I'm going to find out how to install webalizer correctly.
 
Strange, webalizer should have been installed by DA installation procedure.

Anyway, I believe you can try this:

cd /usr/local/directadmin/customapache
./build webalizer
 
Back
Top