From: Daniel Gruno Date: Thu, 26 Apr 2012 17:42:34 +0000 (+0000) Subject: Syntaxe updates for mod_e*.xml X-Git-Tag: 2.5.0-alpha~7003 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25486e2d9946799be19d938808c83b1c069c207b;p=apache Syntaxe updates for mod_e*.xml git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1330988 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_echo.xml b/docs/manual/mod/mod_echo.xml index 46c6975772..af670949de 100644 --- a/docs/manual/mod/mod_echo.xml +++ b/docs/manual/mod/mod_echo.xml @@ -52,7 +52,9 @@ later. disables the echo server.

Example + ProtocolEcho On + diff --git a/docs/manual/mod/mod_env.xml b/docs/manual/mod/mod_env.xml index 7a48c9061f..51d4f2eb1a 100644 --- a/docs/manual/mod/mod_env.xml +++ b/docs/manual/mod/mod_env.xml @@ -56,7 +56,9 @@ SSI pages httpd process.

Example + PassEnv LD_LIBRARY_PATH + @@ -74,7 +76,9 @@ SSI pages HTTP Server modules, and passed on to CGI scripts and SSI pages.

Example + SetEnv SPECIAL_PATH /foo/bin +

The internal environment variables set by this directive are set @@ -104,7 +108,9 @@ SSI pages on to CGI scripts and SSI pages.

Example + UnsetEnv LD_LIBRARY_PATH + diff --git a/docs/manual/mod/mod_example.xml b/docs/manual/mod/mod_example.xml index 94e3cd23be..36f66a52c7 100644 --- a/docs/manual/mod/mod_example.xml +++ b/docs/manual/mod/mod_example.xml @@ -99,18 +99,18 @@

To activate the example module, include a block similar to the following in your httpd.conf file:

- - <Location /example-info>
- SetHandler example-handler
- </Location> -
+ +<Location /example-info> + SetHandler example-handler +</Location> +

As an alternative, you can put the following into a .htaccess file and then request the file "test.example" from that location:

- + AddHandler example-handler .example - +

After reloading/restarting your server, you should be able to browse to this location and see the brief display mentioned diff --git a/docs/manual/mod/mod_expires.xml b/docs/manual/mod/mod_expires.xml index 00edb03a73..40d488ab52 100644 --- a/docs/manual/mod/mod_expires.xml +++ b/docs/manual/mod/mod_expires.xml @@ -62,12 +62,10 @@ criteria ExpiresByType directives can also be defined in a more readable syntax of the form:

- - ExpiresDefault "base [plus num type] - [num type] ..."
- ExpiresByType type/encoding "base [plus num type] - [num type] ..." -
+ +ExpiresDefault "base [plus num type] [num type] ..." +ExpiresByType type/encoding "base [plus num type] [num type] ..." +

where base is one of:

@@ -98,21 +96,19 @@ criteria make documents expire 1 month after being accessed, by default:

- - ExpiresDefault "access plus 1 month"
- ExpiresDefault "access plus 4 weeks"
- ExpiresDefault "access plus 30 days" -
+ +ExpiresDefault "access plus 1 month" +ExpiresDefault "access plus 4 weeks" +ExpiresDefault "access plus 30 days" +

The expiry time can be fine-tuned by adding several 'num type' clauses:

- - ExpiresByType text/html "access plus 1 month 15 - days 2 hours"
- ExpiresByType image/gif "modification plus 5 hours 3 - minutes" -
+ +ExpiresByType text/html "access plus 1 month 15 days 2 hours" +ExpiresByType image/gif "modification plus 5 hours 3 minutes" +

Note that if you use a modification date based setting, the Expires header will not be added to content @@ -193,13 +189,15 @@ by MIME type repeatedly within a relatively short timespan).

Example: - # enable expirations
- ExpiresActive On
- # expire GIF images after a month in the client's cache
- ExpiresByType image/gif A2592000
- # HTML documents are good for a week from the
- # time they were changed
- ExpiresByType text/html M604800 + +# enable expirations +ExpiresActive On +# expire GIF images after a month in the client's cache +ExpiresByType image/gif A2592000 +# HTML documents are good for a week from the +# time they were changed +ExpiresByType text/html M604800 +

Note that this directive only has effect if diff --git a/docs/manual/mod/mod_ext_filter.xml b/docs/manual/mod/mod_ext_filter.xml index 8a1ea12377..f663e2b4d5 100644 --- a/docs/manual/mod/mod_ext_filter.xml +++ b/docs/manual/mod/mod_ext_filter.xml @@ -60,30 +60,25 @@ delivery to the client

Examples
Generating HTML from some other type of response - - # mod_ext_filter directive to define a filter
- # to HTML-ize text/c files using the external
- # program /usr/bin/enscript, with the type of
- # the result set to text/html
- ExtFilterDefine c-to-html mode=output \
- - intype=text/c outtype=text/html \
- cmd="/usr/bin/enscript --color -W html -Ec -o - -"
-
-
- <Directory "/export/home/trawick/apacheinst/htdocs/c">
- - # core directive to cause the new filter to
- # be run on output
- SetOutputFilter c-to-html
-
- # mod_mime directive to set the type of .c
- # files to text/c
- AddType text/c .c
-
-
- </Directory> -
+ +# mod_ext_filter directive to define a filter +# to HTML-ize text/c files using the external +# program /usr/bin/enscript, with the type of +# the result set to text/html +ExtFilterDefine c-to-html mode=output \ + intype=text/c outtype=text/html \ + cmd="/usr/bin/enscript --color -W html -Ec -o - -" + +<Directory "/export/home/trawick/apacheinst/htdocs/c"> + # core directive to cause the new filter to + # be run on output + SetOutputFilter c-to-html + + # mod_mime directive to set the type of .c + # files to text/c + AddType text/c .c +</Directory> +
Implementing a content encoding filter @@ -91,116 +86,99 @@ delivery to the client Please refer to mod_deflate for a practical implementation.

- - # mod_ext_filter directive to define the external filter
- ExtFilterDefine gzip mode=output cmd=/bin/gzip
-
- <Location /gzipped>
- - # core directive to cause the gzip filter to be
- # run on output
- SetOutputFilter gzip
-
- # mod_header directive to add
- # "Content-Encoding: gzip" header field
- Header set Content-Encoding gzip
-
- </Location> -
+ +# mod_ext_filter directive to define the external filter +ExtFilterDefine gzip mode=output cmd=/bin/gzip + +<Location /gzipped> + + # core directive to cause the gzip filter to be + # run on output + SetOutputFilter gzip + + # mod_header directive to add + # "Content-Encoding: gzip" header field + Header set Content-Encoding gzip +</Location> +
Slowing down the server - - # mod_ext_filter directive to define a filter
- # which runs everything through cat; cat doesn't
- # modify anything; it just introduces extra pathlength
- # and consumes more resources
- ExtFilterDefine slowdown mode=output cmd=/bin/cat \
- - preservescontentlength
-
-
- <Location />
- - # core directive to cause the slowdown filter to
- # be run several times on output
- #
- SetOutputFilter slowdown;slowdown;slowdown
-
- </Location> -
+ +# mod_ext_filter directive to define a filter +# which runs everything through cat; cat doesn't +# modify anything; it just introduces extra pathlength +# and consumes more resources +ExtFilterDefine slowdown mode=output cmd=/bin/cat \ + preservescontentlength + +<Location /> + # core directive to cause the slowdown filter to + # be run several times on output + # + SetOutputFilter slowdown;slowdown;slowdown +</Location> +
Using sed to replace text in the response - - # mod_ext_filter directive to define a filter which
- # replaces text in the response
- #
- ExtFilterDefine fixtext mode=output intype=text/html \
- - cmd="/bin/sed s/verdana/arial/g"
-
-
- <Location />
- - # core directive to cause the fixtext filter to
- # be run on output
- SetOutputFilter fixtext
-
- </Location> -
+ +# mod_ext_filter directive to define a filter which +# replaces text in the response +# +ExtFilterDefine fixtext mode=output intype=text/html \ + cmd="/bin/sed s/verdana/arial/g" + +<Location /> + # core directive to cause the fixtext filter to + # be run on output + SetOutputFilter fixtext +</Location> +
Tracing another filter - - # Trace the data read and written by mod_deflate
- # for a particular client (IP 192.168.1.31)
- # experiencing compression problems.
- # This filter will trace what goes into mod_deflate.
- ExtFilterDefine tracebefore \
- - cmd="/bin/tracefilter.pl /tmp/tracebefore" \
- EnableEnv=trace_this_client
-
-
- # This filter will trace what goes after mod_deflate.
- # Note that without the ftype parameter, the default
- # filter type of AP_FTYPE_RESOURCE would cause the
- # filter to be placed *before* mod_deflate in the filter
- # chain. Giving it a numeric value slightly higher than
- # AP_FTYPE_CONTENT_SET will ensure that it is placed
- # after mod_deflate.
- ExtFilterDefine traceafter \
- - cmd="/bin/tracefilter.pl /tmp/traceafter" \
- EnableEnv=trace_this_client ftype=21
-
-
- <Directory /usr/local/docs>
- - SetEnvIf Remote_Addr 192.168.1.31 trace_this_client
- SetOutputFilter tracebefore;deflate;traceafter
-
- </Directory> -
+ +# Trace the data read and written by mod_deflate +# for a particular client (IP 192.168.1.31) +# experiencing compression problems. +# This filter will trace what goes into mod_deflate. +ExtFilterDefine tracebefore \ + cmd="/bin/tracefilter.pl /tmp/tracebefore" \ + EnableEnv=trace_this_client + +# This filter will trace what goes after mod_deflate. +# Note that without the ftype parameter, the default +# filter type of AP_FTYPE_RESOURCE would cause the +# filter to be placed *before* mod_deflate in the filter +# chain. Giving it a numeric value slightly higher than +# AP_FTYPE_CONTENT_SET will ensure that it is placed +# after mod_deflate. +ExtFilterDefine traceafter \ + cmd="/bin/tracefilter.pl /tmp/traceafter" \ + EnableEnv=trace_this_client ftype=21 + +<Directory /usr/local/docs> + SetEnvIf Remote_Addr 192.168.1.31 trace_this_client + SetOutputFilter tracebefore;deflate;traceafter +</Directory> + Here is the filter which traces the data: - #!/usr/local/bin/perl -w
- use strict;
-
- open(SAVE, ">$ARGV[0]")
- - or die "can't open $ARGV[0]: $?";
-
-
- while (<STDIN>) {
- - print SAVE $_;
- print $_;
-
- }
-
- close(SAVE); + +#!/usr/local/bin/perl -w +use strict; + +open(SAVE, ">$ARGV[0]") + or die "can't open $ARGV[0]: $?"; + +while (<STDIN>) { + print SAVE $_; + print $_; +} + +close(SAVE); +
@@ -326,9 +304,9 @@ delivery to the client filter is removed and the request continues without it. - Example + ExtFilterOptions LogStderr - +

Messages written to the filter's standard error will be stored in the Apache error log.