[mirrorbrain-commits] r8108 - /trunk/mod_mirrorbrain/mod_mirrorbrain.conf

From: <poeml_at_mirrorbrain.org>
Date: Sun, 05 Sep 2010 21:42:29 -0000
Author: poeml
Date: Sun Sep  5 23:42:27 2010
New Revision: 8108

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8108&view=rev
Log:
mod_mirrorbrain.conf example config:
- update and restructure the logging examples
- document the new MirrorBrainTorrentTrackerURL and MirrorBrainDHTNode directives

Modified:
    trunk/mod_mirrorbrain/mod_mirrorbrain.conf

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.conf
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.conf?rev=8108&r1=8107&r2=8108&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.conf (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.conf Sun Sep  5 23:42:27 2010
_at_@ -19,34 +19,39 @@
     # %{MB_FILESIZE}e        the size of the file
     # %{MB_REDIRECTED}e      '1' if the request was redirected
     # %{MB_NOMIRROR}e        '1' if no mirror was found
-    # The following two are not always set, because, for performance reasons,
-    # mod_mirrorbrain doesn't do a geoip lookup for every request, but only
-    # when needed. For instance, if files are excluded from redirection,
-    # the lookup will not be reached in the codepath.
     # %{MB_CONTINENT_CODE}e  the client's continent code
     # %{MB_COUNTRY_CODE}e    the client's country code
-    # FIXME: the above is GeoIP now, or not?
 
-    # Log where we redirected to, through the the %{Location}o logging variable
+    # Example of a good, detailed access log:
+    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \
+want:%{WANT}e give:%{GIVE}e r:%{MB_REALM}e %{X-MirrorBrain-Mirror}o \
+%{MB_CONTINENT_CODE}e:%{MB_COUNTRY_CODE}e ASN:%{ASN}e P:%{PFX}e \
+%I %O size:%{MB_FILESIZE}e %{Range}i" combined_redirect
+
+    # Same example, but also uses mod_logio to log actual sent bytes):
+    <IfModule mod_logio.c>
+        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \
+want:%{WANT}e give:%{GIVE}e r:%{MB_REALM}e %{X-MirrorBrain-Mirror}o \
+%{MB_CONTINENT_CODE}e:%{MB_COUNTRY_CODE}e ASN:%{ASN}e P:%{PFX}e \
+%I %O size:%{MB_FILESIZE}e %{Range}i" combinedio_redirect
+    </IfModule>
+
+    # Simpler log that just includes where we redirected to, through the the %{Location}o logging variable
     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Location}o\"" mirrorbrain
     CustomLog "|/usr/sbin/rotatelogs2 /var/log/apache2/redirects_%Y-%m-%d-%H 3600 -0" mirrorbrain
 
-    # Or, write an extra file logging _only_ redirections. mod_mirrorbrain sets the
-    # environment variable MB_REDIRECTED to 1 whenever it redirects a client.
-    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Location}o\"" redirected
-    CustomLog /var/log/apache2/redirected_log redirected env=MB_REDIRECTED
-
-
+    # Example #1 for conditional logging:
     # Whenever no mirror is found for a file, mod_mirrorbrain sets the enviroment
     # variable MB_NOMIRROR. This can be used to write an additional file
     # logging all unmirrored files, including the bytes we served ourselves:
     LogFormat "%h %t %U %B \"%{Referer}i\"" nomirror
     CustomLog /var/log/apache2/unmirrored_log nomirror env=MB_NOMIRROR
 
-    # Example of detailed access log (also uses mod_logio to log actual sent bytes):
-    <IfModule mod_logio.c>
-    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{X-MirrorBrain-Chose-Mirror}o %I %O %{MB_CONTINENT_CODE}e:%{MB_COUNTRY_CODE}e size:%{MB_FILESIZE}e" combinedio_redirect
-    </IfModule>
+    # Example #2 for conditional logging:
+    # Or, write an extra file logging _only_ redirections. mod_mirrorbrain sets the
+    # environment variable MB_REDIRECTED to 1 whenever it redirects a client.
+    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Location}o\"" redirected
+    CustomLog /var/log/apache2/redirected_log redirected env=MB_REDIRECTED
 
 
 
_at_@ -165,6 +170,16 @@
     # This is limited to .iso and .dmg files in this example, because then Apache
     # doesn't need to do this additional check for each request.
     MirrorBrainMetalinkTorrentAddMask "\.(iso|dmg)$"
+    
+
+    # Define the URL a BitTorrent Tracker to be included in Torrents and in
+    # Magnet links. Directive can be repeated to specify multiple URLs.
+    MirrorBrainTorrentTrackerURL "http://bt.mirrorbrain.org:8091/announce"
+    MirrorBrainTorrentTrackerURL "udp://bt.mirrorbrain.org:8091/announce"
+    # Define a DHT node to be included in Torrents links. Directive can be
+    # repeated to specify multiple nodes, and takes two arguments (hostname, port).
+    MirrorBrainDHTNode router.bitcomet.com 554
+    MirrorBrainDHTNode router.bittorrent.com 6881
 
 
     <Directory /srv/www/htdocs/base_dir/some_other_dir>




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sun Sep 05 2010 - 21:42:31 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT