The situation: Each user has their own public HTTP directory, meant for images only. This could easily be abused by users using it to serve large files, wasting bandwidth.

The question: Is there any fairly simple way to prevent this abuse? Either by allowing the webserver to only images to be served, restricting size, or some other method.

link|improve this question
This would probably be better suited as a question in serverfault. Although, to take a stab at it, you could create a rewrite rule for lighthttpd and allow certain file extensions and restrict to a size. I'd check in serverfault though. – lewiguez Jun 7 '10 at 1:35
@lewiguez thanks for the suggestion to post at serverfault, which seems like a more appropriate place, as well as for your stab at it – sutre Jun 7 '10 at 1:51
feedback

migrated from stackoverflow.com Jun 7 '10 at 1:53

This question came from our site for professional and enthusiast programmers.

1 Answer

There are two things you can do:

  1. Setup a rewrite rule for lighthttpd and only allow the image file extensions .Gif .jpg, .png, .jpeg
  2. Stop users from hot linking to images so that they can't simply download or link to the files for leeching

ways to stop leeching in lighthttpd (from google search)

http://www.google.com.au/search?q=lighthttpd+stop+image+hotlinking

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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