Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

bandwidth Apache Module

by MiDgArD (Novice)
on Feb 19, 2007 at 20:09 UTC ( #600945=perlquestion: print w/replies, xml ) Need Help??
MiDgArD has asked for the wisdom of the Perl Monks concerning the following question:

How I can create a apache (1.3.x) module to get the bandiwidht of my vhosts?

I would like to limit the bandiwidth for all vhost, but this limit is porsonalized, for example: -> 1gb -> 500MB

How i can create this module? (with mysql to log all traffic per day by month, and if the site crash your limit, he show the error msg "Bandwidth limit exceeded")

Or do you know another solution?

Tthank you

Replies are listed 'Best First'.
Re: bandwidth Apache Module
by stonecolddevin (Parson) on Feb 19, 2007 at 20:31 UTC

    Haven't dealt with this personally, but check out Apache::Quota. Needs mod_perl and apache 1.3.x


      How I can install it in the httpd.conf?

      I've tried this:

      PerlLoadModule Apache::Quota
      PerlSetVar QuotaFile /tmp/Apache-Quota.db
      PerlSetVar QuotaLocker BerkeleyDB

      <VirtualHost X.Y.Z.W>
      <Location />
      PerlSetVar QuotaLocationKey /
      PerlSetVar QuotaType global
      PerlSetVar QuotaPeriod 30d
      PerlSetVar QuotaLimit 1M
      PerlSetVar QuotaOnExceed deny
      PerlFixupHandler Apache::Quota

      But this don't start my apache ...
        Are you running mod_perl? If not, you either need to install mod_perl or look at something in C, like mod_bandwidth. In my opinion, monitoring bandwidth is better done with one of the C modules because they'll be more lightweight.
        Have you tried apache/bin/apachectl configtest? (At least I think it's in apache/bin.)



        -- Yeah, I'm a Delt.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://600945]
Approved by andyford
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2018-07-16 04:28 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (332 votes). Check out past polls.