Talk:Webalizer

Great article! I was trying to get Webalizer installed, and failed before, But now I know how! (That incremental log file setting was the thing that got me)

Bad Minute Errors
Is that bad minute error that results when using the default editor due to bad line wrapping? I was getting hte same error in vi until I figured out there was more than one line. When using the default editor, saving wrote out 3 lines when there should only have been one.

Cant find libdb-4.4.so
I installed the Webalizer ELF binaries and it complains that libdb-4.4.so cant be found.

Use version 2.01-10
Webalizer version 2.20-01 has the problem loading the library libdb-4.4.so.

Download version 2.01-10. It has a statically compiled binary.

64-Bit
Can anyone make a version for the new 64bit DH servers? The binary on the webalizer site doesn't work.

Symlink Error
I'm on a new xeon server which I'm pretty sure is 64bit. I can make the binary ok from the current source.

To build the current source, do: wget whereverthecurrentsource tar zxf currentsource_filename cd webalizer-xxxxxx ./configure --prefix=$HOME  OR perhaps you might put it in its own directory: --prefix=$HOME/webalizer make make install That's it. You'll find the config file at etc/webalizer.conf.sample underneath where you installed webalizer.

Unfortunately, it errors when I run it. It complains that: "Can't open log file /home/xxx/logs/xxx/http/access.log.0 (symlink)". Google has very little. I gather that the latest version has some sort of checking for a symlink to the log file and refuses to run.

It's mentioned in the CHANGES file. 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.

Frankly, while I understand the problem, this fix is worse. I would have thought that every commercial hoster would use a symlink to point to the latest log file. I do it myself on my home server.

The fix is to specify, in your config file, the actual log file name (the http symlink is ok, you don't need to change that). Unfortunately, this means that using a cron job is a problem.

I've had a bit of a think about it. To me, it seems there are two options: use the current log file (access.log) and accept you will miss some connections that are taking place while you run the report; or always use an old report such as access.log.yyyy-mm-dd.gz. That means you won't be completely up to date, but you will have a full report.

To do that, you either have to manually edit your conf file every time you run webalizer, or you could do a small script run from cron. The script will edit the conf file to change the log file name to the latest date and then run webalizer. Something like (not tested): LOGDATE=$(date -d yesterday +'%Y-%m-%d')    # dreamhost has GNU extensions, thank goodness LOGFILEBASE="/home/xxxx/logs/yyyyyy/http/access\.log" LOGFILE="${LOGFILEBASE}\.${LOGDATE}\.gz"    # you might want to leave off the \.gz at the end, depending on when you run this script sed -i 's:LogFile.*$:LogFile '${LOGFILE}':'  yyyyyy.conf webalizer -c yyyyyy.conf
 * 1) /bin/sh

And set that to run once yesterday's logs have been rolled over and the new day's have started. NickC 01:48, 29 January 2010 (UTC)

Symlink Error proposed fix
Vicm3. As webalizer is C, I take a look at the code and the lines that stop the program in version 2.23-05 are in webalizer.c lines 497 and 498, code follows: /* stat the file */ if ( !(lstat(log_fname, &log_stat)) ) {        /* check if the file a symlink */ if ( S_ISLNK(log_stat.st_mode) ) {           if (verbose) fprintf(stderr,"%s %s (symlink)\n",msg_log_err,log_fname); /* exit(EBADF); */ }     }

The line on bold where originaly whithout the /* */ just comment it and the program checks the symlink and complains, but goes on.