Lines 3-5 are comments. This variable gets used later to datestamp log files. Notice the backticks, just as we used in the previous script lcf. At this point we're ready to re-start Apache, line 17. For efficiency, Apache is normally configured to log only IP addresses.
Normal practice is to resolve the addresses into names later, in batch mode during non-peak hours.
Apache provides the filter program logresolve to do the job of resolving names. Now the majority of the work is done and we just need to finish things up. All that's left is to compress them with gzip, which we do in line 25. If you use a different stats program, adjust this line accordingly. To have this script run at midnight, we add it to cron.