Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.