Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My problem

I have a debian squeeze installation running nginx as my webserver and handling PHP5 requests using php-fpm, which works fine. I have one directory, which holds static zip files of a program in different versions. What I would like to have is a nice download statistics about which file was downloaded how often. I am not sure what would be the best way to implement it. I have set up a separate location block in my configuration file to log these downloads separately.

Acquiring raw data

For the acquisition of the raw data, meaning the download numbers I have two possibilities in mind:

  1. Using a script written in perl to parse the log files on a regular basis.
  2. Using the post_action directive in my separate location block to trigger a logging script when the download has finished.

Processing the data

To process and log the data I could imaging using different tools:

  1. Store the values like filename and download times in a sqlite database and read data from there.
  2. Use rrdtool to directly store the data in a round-robin manner which would also make generating graphs very easy.

There is another possibility of making all the above steps obsolete, but I do not know if it could work out. I am using google analytics for this site, could I somehow log these download numbers with this? By doing this I would not have to implement anything.

share|improve this question

1 Answer 1

if you can log your accesses to a different log file, you should also be able to specify the format of the log file and awstats should be able to process the log and is cronjob'able so can regularly process the results and will have reasonably decent statistics for you

if you want to do funky graphing however (awstats only does basic bars) then you will need something else

share|improve this answer
    
Thanks for your answer. As written in my question I am already logging the downloads separately to a different log file. Awstats would be a possibility but I do not like it as it seems a bit bloated. –  GorillaPatch Apr 6 '11 at 12:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.