Author: poeml Date: 2009-03-09 05:36:28 -0600 (Mon, 09 Mar 2009) New Revision: 6752 Modified: trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.conf Log: mod_mirrorbrain: - more and improved documentation on some of the configuration directives in the mod_mirrorbrain.conf example file. - update some of the environment variables from Apache's subprocess env, which are used for logging, to their new and shorter names (MIRRORBRAIN_* -> MB_*) Modified: trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.conf =================================================================== --- trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.conf 2009-03-09 11:32:46 UTC (rev 6751) +++ trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.conf 2009-03-09 11:36:28 UTC (rev 6752) @@ -21,35 +21,36 @@ # Available details for logging with the CustomLog directive: # %{Location}o the full redirection URL # %{X-MirrorBrain-Chose-Mirror}o the mirror identifier - # %{MIRRORBRAIN_FILESIZE}e the size of the file - # %{MIRRORBRAIN_REDIRECTED}e '1' if the request was redirected - # %{MIRRORBRAIN_NOMIRROR}e '1' if no mirror was found + # %{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. - # %{MIRRORBRAIN_CONTINENT_CODE}e the client's continent code - # %{MIRRORBRAIN_COUNTRY_CODE}e the client's country code + # %{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 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 MIRRORBRAIN_REDIRECTED to 1 whenever it redirects a client. + # 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=MIRRORBRAIN_REDIRECTED + CustomLog /var/log/apache2/redirected_log redirected env=MB_REDIRECTED # Whenever no mirror is found for a file, mod_mirrorbrain sets the enviroment - # variable MIRRORBRAIN_NOMIRROR. This can be used to write an additional file + # 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=MIRRORBRAIN_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 %{MIRRORBRAIN_CONTINENT_CODE}e:%{MIRRORBRAIN_COUNTRY_CODE}e size:%{MIRRORBRAIN_FILESIZE}e" combinedio_redirect + 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> @@ -102,25 +103,43 @@ MirrorBrainHandleHEADRequestLocally Off # Don't redirect for files smaller than 4096 bytes + # A redirect would only cost resources (database lookup, mirrorlist generation, + # additional roundtrip for the client), but not save anything; it's + # cheaper to deliver small content directly. MirrorBrainMinSize 4096 + # Regexp which determines which files will be excluded from redirecting. + # Perfect for signatures -- small files that you rather want to deliver + # yourself for security reasons. + # + # The directive is not additive. Use it once. + # + # Note, this type of file is typically quite small and would be delivered + # directly also when you have MirrorBrainMinSize 4096 configured, for instance. + # But even though the files would be covered by that rule, it is better + # to make the rule explicit. + # + # Note, A very similar effect can be achieved with the + # MirrorBrainExcludeMimeType directive; or it might be even easier. + MirrorBrainExcludeFileMask "\.(md5|sha1|asc)" + # Set to On/Off to handle directory listings locally (don't redirect) MirrorBrainHandleDirectoryIndexLocally On # User-Agent to always exclude from redirecting (wildcards allowed) MirrorBrainExcludeUserAgent w3m/0.5.1 - # Network to always exclude from redirecting (simple string prefix comparison) + # Networks or IP addresses to always exclude from redirecting. This + # directive is additive and can be repeated. Note that for networks, a + # simple string prefix comparison is used to match on them, and not + # prefix matching. MirrorBrainExcludeNetwork 192.168. - - # IP address to always exclude from redirecting MirrorBrainExcludeNetwork 10.10.10.1 # Mimetype to always exclude from redirecting (wildcards allowed) + # The directive is additive and can be repeated. MirrorBrainExcludeMimeType text/xml - # Regexp which determines which files will be excluded form redirecting - MirrorBrainExcludeFileMask "\.(xml|xml\.gz|xml\.asc)" </Directory> # For files matching the following file mask (regular expression), _______________________________________________ Opensuse-svn mailing list Opensuse-svn_at_forge.novell.com http://forge.novell.com/mailman/listinfo/opensuse-svn _______________________________________________ mirrorbrain-commits mailing list Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on 2009-03-09Z11:37:07
This archive was generated by hypermail 2.2.0 : 2009-07-10Z19:18:12 GMT