This is a discussion on Some apache configuration problem within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi, I want to prevent any mp3 file download at 9:00PM to 11:00PM every day. So, the question ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I want to prevent any mp3 file download at 9:00PM to 11:00PM every day. So, the question is that I need a way to let Apache server to know what the time is when there is request coming. When it is between the time, Apache should prevent the request. That is all. But I did not find such a way to do this. Could you please help me ? Thanks in advace! Regards! Bo |
|
|||
|
On 22 Oct, 12:24, Bo Yang <struggl...@gmail.com> wrote:
> Hi, > I want to prevent any mp3 file download at 9:00PM to 11:00PM every > day. So, the question is that I need a way to let Apache server to > know what the time is when there is request coming. When it is between > the time, Apache should prevent the request. That is all. But I did > not find such a way to do this. Could you please help me ? > Thanks in advace! > > Regards! > Bo AFAIK this is not possible with Apache - you'd need to write a CGI wrapper around the mp3 file but move the file outside the document root. C. |
|
|||
|
On Mon, 22 Oct 2007 11:24:28 -0000
Bo Yang <struggleyb@gmail.com> wrote: > Hi, > I want to prevent any mp3 file download at 9:00PM to 11:00PM every > day. There's an example module in my book that restricts access to a system according to day-of-the-week. You could easily adapt that to time of day (and the source is online at the book's companion site). Alternatively, you could hack it with mod_rewrite. -- Nick Kew Application Development with Apache - the Apache Modules Book http://www.apachetutor.org/ |
|
|||
|
Bo Yang wrote:
> Hi, > I want to prevent any mp3 file download at 9:00PM to 11:00PM every > day. So, the question is that I need a way to let Apache server to > know what the time is when there is request coming. When it is between > the time, Apache should prevent the request. That is all. But I did > not find such a way to do this. Could you please help me ? > Thanks in advace! > > Regards! > Bo > This is a configuration using mod_rewrite that I added after one of our clients got carried away with their site check application. If this agent shows up between 3 AM and 9 PM, their request is rewritten to a script that generates a 503 error page (and takes its time doing so). ############ SPECIAL #################### # ban certain agents between 3 AM and 9 PM ######################################## RewriteCond %{TIME_HOUR}%{TIME_MIN} >0300 RewriteCond %{TIME_HOUR}%{TIME_MIN} <2100 RewriteCond %{HTTP_USER_AGENT} Rational\ SiteCheck [NC] RewriteRule .* /apache_error/fake_503_with_delay.ksh [L,PT] Jim |
|
|||
|
On Oct 22, 11:26 pm, Jim Hayter <see.reply...@nowhere.invalid> wrote:
> Bo Yang wrote: > > Hi, > > I want to prevent any mp3 file download at 9:00PM to 11:00PM every > > day. So, the question is that I need a way to let Apache server to > > know what the time is when there is request coming. When it is between > > the time, Apache should prevent the request. That is all. But I did > > not find such a way to do this. Could you please help me ? > > Thanks in advace! > > > Regards! > > Bo > > This is a configuration using mod_rewrite that I added after one of our > clients got carried away with their site check application. If this > agent shows up between 3 AM and 9 PM, their request is rewritten to a > script that generates a 503 error page (and takes its time doing so). > ############ SPECIAL #################### > # ban certain agents between 3 AM and 9 PM > ######################################## > RewriteCond %{TIME_HOUR}%{TIME_MIN} >0300 > RewriteCond %{TIME_HOUR}%{TIME_MIN} <2100 > RewriteCond %{HTTP_USER_AGENT} Rational\ SiteCheck [NC] > RewriteRule .* /apache_error/fake_503_with_delay.ksh [L,PT] This is what I need, thank you very much for your help! Regards! Bo |
| Thread Tools | |
| Display Modes | |
|
|