One thing I’ve encountered with Awstats is adding in old apache log files. This is useful if you are migrating data from servers. By default, Awstats will ignore ALL past dates in the log that occur before the most recent log entry date. In order to avoid Awstats from finding the “recent log entry date”, you will need move all Awstats cached files into a separate folder. I’ve verified that this works, so if you have any questions feel free to comment.
1) Locate your awstats data directory. Most commonly found in /var/lib/awstats
2) Create a new folder inside the directory. Move all awstats* files to the new folder.
3) Run awstats update process on all log files in chronological order. AWStats will not complain about the “too old record” because there is no history files in DirData directory that contains compiled data more recent than record.
Edit the awstats.conf inside /etc/awstats
Locate the Apache logfile you need. It must be the oldest one you want to import. Awstats will chronologically add in the files, so make sure you add them in the right order. Edit the line starting with LogFile=”[log file location]”
Run the Awstats command (through the web browser or through shell via the perl command line)
4) Move the history files back. Once you process through all the logfiles, move the Awstats history files inside the /var/lib/awstats/newfolder back into /var/lib/awstats