Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to restrict access to a file until the user has paid for it. This is easy enough if I served the file via a web app, but it seems more efficient to have httpd serve the file. Is there a way to get apache to ask a web app if it can serve a file before serving it? As I'm typing this it seems like it should be trivial but I'm not coming up with a good answer via google. Thanks in advance for any help.

share|improve this question
up vote 1 down vote accepted

That depends a bit on your setup.
If you are generating the links to the protected file in your application and you are fine that the link is different for each user, then mod-auth-token could work for you.
The link will also expire after a configurable amount of time, this prevents that users share the link.

share|improve this answer

Your Answer


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.