How to limit max downloads in apache?
How do you limit the max number of simultaneous downloads at same time and display a too many users error when that limit has been reached in apache?
-
There are probably many ways of achieving this ...... here is one way I would explore if I were trying to solve the problem..... Use PHP to create session files for each started download, that were then stored or enumerated in a database (MySQL or SQLite - whatever rocks your world), and counted before allowing a new session (file download) to be started - if the number of sessions is over the set limit -> display "too many users" error. Don't forget to delete the session entry when the download finishes. Use your favourite search engine to look for "PHP how to count downloads" for ideas and code examples. 0 -
Hello @Stouf, Let us know how it turns out. Thanks! 0 -
What php scripts can do this? 0 -
Hello @Stouf, I don't have a specific PHP script to recommend, but there are some limits you can configure for Apache in WHM >> Apache Configuration >> Global Configuration. For instance, Max Request Workers is a value you could adjust: [QUOTE] This directive sets the limit on the number of simultaneous requests that will be served. This interface allows up to the value of the ServerLimit setting. This used to be called 'MaxClients' prior to Apache 2.4.
Thank you.0
Please sign in to leave a comment.
Comments
4 comments