July 12, 2007

Awstats stopped updating

Install Geo::IP Perl Module and Install dos2unix on Debian linux

DOS text files traditionally have carriage return and line feed pairs as their newline characters, while Unix text files have the line feed as their newline character. We often find myself needing to ‘clean-up’ some files saved with Win/DOS characters, and this can be done very easy with dos2unix. While RedHat based Linux distributions will traditionally include these small utils by default, on Debian we have to install them if needed.

The file logresolvemerge.pl included in the awstats package from Debian, needs cleaning up as showed by the error:

/usr/share/doc/awstats/examples/logresolvemerge.pl -bash: /usr/share/doc/awstats/examples/logresolvemerge.pl:

/usr/bin/perl^M: bad interpreter: No such file or directory

The dos2unix and corresponding unix2dos, are found in the tofrodos Debian package, and to install the package just type:

#apt-get install tofrodos

Once we have dos2unix installed, I can use it to clean up very easy any file that needs that:

dos2unix logresolvemerge.pl

and the offending DOS characters are gone.