Some apache configuration problem

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-22-2007
Bo Yang
 
Posts: n/a
Default Some apache configuration problem

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

  #2 (permalink)  
Old 10-22-2007
C.
 
Posts: n/a
Default Re: Some apache configuration problem

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.

  #3 (permalink)  
Old 10-22-2007
Nick Kew
 
Posts: n/a
Default Re: Some apache configuration problem

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/
  #4 (permalink)  
Old 10-22-2007
Jim Hayter
 
Posts: n/a
Default Re: Some apache configuration problem

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
  #5 (permalink)  
Old 10-24-2007
Bo Yang
 
Posts: n/a
Default Re: Some apache configuration problem

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:43 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0