SOURCES: apache-mod_cband.conf (NEW), apache-mod_cband.conf.exampl...

adamg adamg at pld-linux.org
Sat Sep 10 20:52:44 CEST 2005


Author: adamg                        Date: Sat Sep 10 18:52:44 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new, not tested yet

---- Files affected:
SOURCES:
   apache-mod_cband.conf (NONE -> 1.1)  (NEW), apache-mod_cband.conf.examples (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/apache-mod_cband.conf
diff -u /dev/null SOURCES/apache-mod_cband.conf:1.1
--- /dev/null	Sat Sep 10 20:52:44 2005
+++ SOURCES/apache-mod_cband.conf	Sat Sep 10 20:52:39 2005
@@ -0,0 +1 @@
+LoadModule cband_module /usr/lib/apache/mod_cband.so

================================================================
Index: SOURCES/apache-mod_cband.conf.examples
diff -u /dev/null SOURCES/apache-mod_cband.conf.examples:1.1
--- /dev/null	Sat Sep 10 20:52:44 2005
+++ SOURCES/apache-mod_cband.conf.examples	Sat Sep 10 20:52:39 2005
@@ -0,0 +1,105 @@
+
+
+per-virtualhost bandwidth limiting configuration
+ Next, you may define virtualhosts bandwidth limits, URL locations and path to the scoreboard file for individual virtualhosts: 
+
+# specify default 'bandwidth exceeded' location
+CBandDefaultExceededURL http://haha.org/bandwidth_exceeded.html
+
+<VirtualHost *:80>
+    DocumentRoot /var/www/xyz.org/
+    ServerName xyz.org
+    CustomLog /var/log/apache2/xyz.org.access combined
+    ErrorLog /var/log/apache2/xyz.org.access.error
+    RewriteEngine On
+    RewriteOptions inherit
+
+    # 100MB virtualhost bandwidth limit
+    CBandLimit 100000
+
+    # redirect to http://abc.org/bandwidth_exceeded.html
+    # when the limit has been reached
+    CBandExceededURL http://abc.org/bandwidth_exceeded.html
+
+    # virtualhost's scoreboard file
+    CBandScoreboard /var/run/apache2/xyz.org.scoreboard
+</VirtualHost>
+
+
+ 
+per-user bandwidth limiting configuration (only in 0.9.1 version)
+ In 0.9.1 you can define limits for users and assign virtualhosts to them 
+
+ 
+# define user 'dembol'
+<CBandUser dembol>
+    # 200MB bandwidth limit for user 'dembol'
+    CBandUserLimit 200000
+
+    # redirect to http://abc.org/bandwidth_exceeded.html
+    # when the limit has been reached
+    CBandUserExceededURL http://abc.org/bandwidth_exceeded.html
+
+    # user's scoreboard file
+    CBandUserScoreboard /var/run/apache2/dembol.scoreboard
+</CBandUser>
+
+
+
+# assign virtualhost 'xyz.org' to user 'dembol'
+<VirtualHost *:80>
+    ServerName xyz.org
+    # Specify virtualhost owner
+    CBandUser dembol
+</VirtualHost>
+
+# assign virtualhost 'aga.org' to user 'dembol'
+<VirtualHost *:80>
+    ServerName aga.org
+    # Specify virtualhost owner
+    CBandUser dembol
+</VirtualHost>
+
+
+ 
+per-user and per-virtualhost bandwidth limiting configuration (only in 0.9.1 version)
+ In 0.9.1 you can also mix per-user and per-virtualhost bandwidth limiting techniques 
+
+ 
+# define user 'dembol'
+<CBandUser dembol>
+    # 200MB bandwidth limit for user 'dembol'
+    CBandUserLimit 200000
+
+    # redirect to http://abc.org/bandwidth_exceeded.html
+    # when the limit has been reached
+    CBandUserExceededURL http://abc.org/bandwidth_exceeded.html
+
+    # user's scoreboard file
+    CBandUserScoreboard /var/run/apache2/dembol.scoreboard
+</CBandUser>
+
+
+# assign virtualhost 'xyz.org' to user 'dembol'
+<VirtualHost *:80>
+    ServerName xyz.org
+    # Specify virtualhost owner
+    CBandUser dembol
+    
+    # 100MB virtualhost bandwidth limit
+    CBandLimit 100000
+
+    # redirect to http://abc.org/bandwidth_exceeded.html
+    # when the limit has been reached
+    CBandExceededURL http://abc.org/bandwidth_exceeded.html
+
+    # virtualhost's scoreboard file
+    CBandScoreboard /var/run/apache2/xyz.org.scoreboard
+</VirtualHost>
+
+# assign virtualhost 'aga.org' to user 'dembol'
+<VirtualHost *:80>
+    ServerName aga.org
+    # Specify virtualhost owner
+    CBandUser dembol
+</VirtualHost>
================================================================



More information about the pld-cvs-commit mailing list