Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Better File Download Site
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Better File Download Site

joshuatlyjoshuatly Member
edited May 2012 in General

Hey wanna ask if anyone have experience in doing a simple file download site?
Im currently serving all the files using nginx from my 128 box and everything went very well.
But Im thinking of doing something that enable me to track the download count, (and possibly referral as well)
Anyone got any idea or any solution that is LEB friendly? (i have a few 256 & 512 sitting there ready to deploy too).

Here are some of my ideas.
Use MongoDB, serve files directly from database, can count download as well.
Anyone have experience with Webalizer or AWStats? How does those things perform in LEB?
Google Analytics? The implementation seems a bit complicated.
Or anyone out there know any good php script that will do the job?

Comments

  • raindog308raindog308 Administrator, Veteran

    Your nginx logs will record each and every download. Just parse 'em.

  • in the log file right? any useful tools?
    Oh by the way about nginx log, one day I was wondering why my 15gb VPS storage is running out, when i dont recall I store that much files there, it is the nginx access log, 9 freaking gb of the access log. LOL.

  • djvdorpdjvdorp Member

    try to set up proper log rotation :P
    the tuxlite.com script does this for you fully automatically hehe ^^ (not mine, use it a lot)

  • lbftlbft Member

    @joshuatly said: MongoDB

    If it's OpenVZ, forget it. MongoDB and OpenVZ do not mix. OpenVZ's memory accounting is funky enough under normal circumstances but when combined with Mongo's extreme love of mmap and reliance on particular virtual memory behaviour it ends up in crashes and misery. Apparently it can be run on the newer RHEL6 OpenVZ kernels with a particular configuration on the host node but don't hold your breath.

    Parsing your access logs sounds like a better idea to me (and it's certainly a lower footprint on a low-memory server) but I don't have any recommendations on tools to do it.

    @joshuatly said: 9 freaking gb of the access log.

    logrotate will take care of that for you.

  • @djvdorp said: try to set up proper log rotation :P

    the tuxlite.com script does this for you fully automatically hehe ^^ (not mine, use it a lot)
    Ok will look into it

    @lbft said: If it's OpenVZ, forget it. MongoDB and OpenVZ do not mix.

    Wow really? I have no idea both of them are not friend.

    @lbft said: logrotate will take care of that for you.

    Yup going to set that up soon.

    Anyone tried Webalizer or AWStats? good? bad?

  • djvdorpdjvdorp Member

    awstats is also included with the script mentioned above by me (lol),
    works pretty decent!

    I will PM you a demo with stats right now

  • Nice, will check it out.

  • joepie91joepie91 Member, Patron Provider
    edited June 2012

    If the logs of nginx are in the same format as those of lighttpd (which I'm not sure about), you can simply run a script I wrote very recently to get statistics:
    http://pastebin.com/QfEMiZ3h

    It doesn't require any installation (like webalizer and awstats), and should run on any VPS with Python installed. It's pretty fast.

    Just save it as parse, chmod +x, and run it as ./parse /path/to/access.log, with the access logs you want to parse as parameters (yes, it can do multiple access logs in one go). It will show you the top referers, files, etc, etc. You can also exclude extensions, run ./parse --help for more information on switches that you can use.

    As for AWStats, it will run on a LEB just fine. Just set up a cronjob for the parsing script, and it should work without really causing any impact, even on a low-RAM VPS. Setup is a bit painful though in my experience.

    EDIT: If the log format is different, it should be trivial to edit the script.

  • Thanks, will try it out!

Sign In or Register to comment.