2

I am in the process of starting a affiliate program and i am providing hosted flv/mp4 files as a promo tools.

so ill be serving these video files to hundreds of surfers.

my question is how do i limit the connections for these files, idk what its exactly say, but something like disabling segment download

so when users use download managers it wont start multiple connections with download resume option.

so my files can be served slowly to the flash video player only.

like when downloading files from some servers using download manager it shows "no resume supported" and only one connection downloads the file.

can this be done with apache ? if yes then what is it called ?

i am using apache for serving files

hope this clears up what i am looking for., thanks

3 Answers3

4

okie., i have found a solution here

http://www.apachelounge.com/viewtopic.php?p=9754

adding this in .htaccess does the trick

Header set Accept-Ranges none
RequestHeader unset Range 

hope this helps., for someone looking for same solution.

  • Thanks for the tips. I'd like to know how many connections for example they can open for the same mp4 or mp3 file. 2? 5? 10? 30? – KeitelDOG Sep 26 '18 at 02:45
1

You can do both of these things, using mod_rewrite + mod_headers (both come with Apache) -

A. Disable segment (byte range) downloads.

B. Block multiple connections started by Download Managers.

Into the directory's .htaccess file, try placing this configuration:

Header set Accept-Ranges none
RewriteCond %{HTTP:Range} !^$
RewriteRule .* - [F,L]

This will simply drop anything requesting parts of a file (instead of the whole file).

*You'll need to make sure the above modules are loaded, Rewrite Engine in ON, and the above directives are enabled to be used in htaccess context.

For a more comprehensive configuration and explanation, see Blocking Download Managers and Accelerators.

rightstuff
  • 6,412
  • 31
  • 20
0

It can be done with apache but you would have to write your own module. Your best bet is to serve the video files through PHP or whatever front end you are using. Then when someone is watching the video, you create a session and put that in the database with their ip. If that video is loaded again while the previous session for that video is still in the database, you reject the connection.

Vish
  • 4,508
  • 10
  • 42
  • 74
  • thats pretty complecated if you ask plus serving files via php will cause more server load, rather i ll look more into serving static files via lighttpd –  Jan 02 '13 at 17:13
  • 1
    The project you want to do is not very complicated. The programming is not hard either. Also, if done cleverly you will not be causing any excessive load. Btw, You will not be able to do this even via lighttpd unless you write your own module. – Vish Jan 03 '13 at 14:08