
humbedooh at apache
Apr 26, 2012, 10:42 AM
Post #1 of 1
(26 views)
Permalink
|
|
svn commit: r1330988 - in /httpd/httpd/trunk/docs/manual/mod: mod_echo.xml mod_env.xml mod_example.xml mod_expires.xml mod_ext_filter.xml
|
|
Author: humbedooh Date: Thu Apr 26 17:42:34 2012 New Revision: 1330988 URL: http://svn.apache.org/viewvc?rev=1330988&view=rev Log: Syntaxe updates for mod_e*.xml Modified: httpd/httpd/trunk/docs/manual/mod/mod_echo.xml httpd/httpd/trunk/docs/manual/mod/mod_env.xml httpd/httpd/trunk/docs/manual/mod/mod_example.xml httpd/httpd/trunk/docs/manual/mod/mod_expires.xml httpd/httpd/trunk/docs/manual/mod/mod_ext_filter.xml Modified: httpd/httpd/trunk/docs/manual/mod/mod_echo.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_echo.xml?rev=1330988&r1=1330987&r2=1330988&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_echo.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_echo.xml Thu Apr 26 17:42:34 2012 @@ -52,7 +52,9 @@ later.</compatibility> disables the echo server.</p> <example><title>Example</title> + <highlight language="config"> ProtocolEcho On + </highlight> </example> </usage> Modified: httpd/httpd/trunk/docs/manual/mod/mod_env.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_env.xml?rev=1330988&r1=1330987&r2=1330988&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_env.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_env.xml Thu Apr 26 17:42:34 2012 @@ -56,7 +56,9 @@ SSI pages</description> <program>httpd</program> process.</p> <example><title>Example</title> + <highlight language="config"> PassEnv LD_LIBRARY_PATH + </highlight> </example> </usage> </directivesynopsis> @@ -74,7 +76,9 @@ SSI pages</description> HTTP Server modules, and passed on to CGI scripts and SSI pages.</p> <example><title>Example</title> + <highlight language="config"> SetEnv SPECIAL_PATH /foo/bin + </highlight> </example> <note><p>The internal environment variables set by this directive are set @@ -104,7 +108,9 @@ SSI pages</description> on to CGI scripts and SSI pages.</p> <example><title>Example</title> + <highlight language="config"> UnsetEnv LD_LIBRARY_PATH + </highlight> </example> </usage> </directivesynopsis> Modified: httpd/httpd/trunk/docs/manual/mod/mod_example.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_example.xml?rev=1330988&r1=1330987&r2=1330988&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_example.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_example.xml Thu Apr 26 17:42:34 2012 @@ -99,18 +99,18 @@ <p>To activate the example module, include a block similar to the following in your <code>httpd.conf</code> file:</p> -<example> - <Location /example-info><br /> - SetHandler example-handler<br /> - </Location> -</example> +<highlight language="config"> +<Location /example-info> + SetHandler example-handler +</Location> +</highlight> <p>As an alternative, you can put the following into a <a href="core.html#accessfilename"><code>.htaccess</code></a> file and then request the file "test.example" from that location:</p> -<example> +<highlight language="config"> AddHandler example-handler .example -</example> +</highlight> <p>After reloading/restarting your server, you should be able to browse to this location and see the brief display mentioned Modified: httpd/httpd/trunk/docs/manual/mod/mod_expires.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_expires.xml?rev=1330988&r1=1330987&r2=1330988&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_expires.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_expires.xml Thu Apr 26 17:42:34 2012 @@ -62,12 +62,10 @@ criteria</description> <directive module="mod_expires">ExpiresByType</directive> directives can also be defined in a more readable syntax of the form:</p> - <example> - ExpiresDefault "<var>base</var> [plus <var>num</var> <var>type</var>] - [<var>num</var> <var>type</var>] ..."<br /> - ExpiresByType type/encoding "<var>base</var> [plus <var>num</var> <var>type</var>] - [<var>num</var> <var>type</var>] ..." - </example> + <highlight language="config"> +ExpiresDefault "<var>base</var> [plus <var>num</var> <var>type</var>] [<var>num</var> <var>type</var>] ..." +ExpiresByType type/encoding "<var>base</var> [plus <var>num</var> <var>type</var>] [<var>num</var> <var>type</var>] ..." + </highlight> <p>where <var>base</var> is one of:</p> @@ -98,21 +96,19 @@ criteria</description> make documents expire 1 month after being accessed, by default:</p> - <example> - ExpiresDefault "access plus 1 month"<br /> - ExpiresDefault "access plus 4 weeks"<br /> - ExpiresDefault "access plus 30 days" - </example> + <highlight language="config"> +ExpiresDefault "access plus 1 month" +ExpiresDefault "access plus 4 weeks" +ExpiresDefault "access plus 30 days" + </highlight> <p>The expiry time can be fine-tuned by adding several '<var>num</var> <var>type</var>' clauses:</p> - <example> - ExpiresByType text/html "access plus 1 month 15 - days 2 hours"<br /> - ExpiresByType image/gif "modification plus 5 hours 3 - minutes" - </example> + <highlight language="config"> +ExpiresByType text/html "access plus 1 month 15 days 2 hours" +ExpiresByType image/gif "modification plus 5 hours 3 minutes" + </highlight> <p>Note that if you use a modification date based setting, the Expires header will <strong>not</strong> be added to content @@ -193,13 +189,15 @@ by MIME type</description> repeatedly within a relatively short timespan).</p> <example><title>Example:</title> - # enable expirations<br /> - ExpiresActive On<br /> - # expire GIF images after a month in the client's cache<br /> - ExpiresByType image/gif A2592000<br /> - # HTML documents are good for a week from the<br /> - # time they were changed<br /> - ExpiresByType text/html M604800 + <highlight language="config"> +# 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 + </highlight> </example> <p>Note that this directive only has effect if Modified: httpd/httpd/trunk/docs/manual/mod/mod_ext_filter.xml URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_ext_filter.xml?rev=1330988&r1=1330987&r2=1330988&view=diff ============================================================================== --- httpd/httpd/trunk/docs/manual/mod/mod_ext_filter.xml (original) +++ httpd/httpd/trunk/docs/manual/mod/mod_ext_filter.xml Thu Apr 26 17:42:34 2012 @@ -60,30 +60,25 @@ delivery to the client</description> <section id="examples"><title>Examples</title> <section><title>Generating HTML from some other type of response</title> - <example> - # mod_ext_filter directive to define a filter<br /> - # to HTML-ize text/c files using the external<br /> - # program /usr/bin/enscript, with the type of<br /> - # the result set to text/html<br /> - ExtFilterDefine c-to-html mode=output \<br /> - <indent> - intype=text/c outtype=text/html \<br /> - cmd="/usr/bin/enscript --color -W html -Ec -o - -"<br /> - </indent> - <br /> - <Directory "/export/home/trawick/apacheinst/htdocs/c"><br /> - <indent> - # core directive to cause the new filter to<br /> - # be run on output<br /> - SetOutputFilter c-to-html<br /> - <br /> - # mod_mime directive to set the type of .c<br /> - # files to text/c<br /> - AddType text/c .c<br /> - <br /> - </indent> - </Directory> - </example> + <highlight language="config"> +# 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> + </highlight> </section> <section><title>Implementing a content encoding filter</title> @@ -91,116 +86,99 @@ delivery to the client</description> Please refer to <module>mod_deflate</module> for a practical implementation.</p> - <example> - # mod_ext_filter directive to define the external filter<br /> - ExtFilterDefine gzip mode=output cmd=/bin/gzip<br /> - <br /> - <Location /gzipped><br /> - <indent> - # core directive to cause the gzip filter to be<br /> - # run on output<br /> - SetOutputFilter gzip<br /> - <br /> - # mod_header directive to add<br /> - # "Content-Encoding: gzip" header field<br /> - Header set Content-Encoding gzip<br /> - </indent> - </Location> - </example> + <highlight language="config"> +# 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> + </highlight> </section> <section><title>Slowing down the server</title> - <example> - # mod_ext_filter directive to define a filter<br /> - # which runs everything through cat; cat doesn't<br /> - # modify anything; it just introduces extra pathlength<br /> - # and consumes more resources<br /> - ExtFilterDefine slowdown mode=output cmd=/bin/cat \<br /> - <indent> - preservescontentlength<br /> - </indent> - <br /> - <Location /><br /> - <indent> - # core directive to cause the slowdown filter to<br /> - # be run several times on output<br /> - #<br /> - SetOutputFilter slowdown;slowdown;slowdown<br /> - </indent> - </Location> - </example> + <highlight language="config"> +# 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> + </highlight> </section> <section><title>Using sed to replace text in the response</title> - <example> - # mod_ext_filter directive to define a filter which<br /> - # replaces text in the response<br /> - #<br /> - ExtFilterDefine fixtext mode=output intype=text/html \<br /> - <indent> - cmd="/bin/sed s/verdana/arial/g"<br /> - </indent> - <br /> - <Location /><br /> - <indent> - # core directive to cause the fixtext filter to<br /> - # be run on output<br /> - SetOutputFilter fixtext<br /> - </indent> - </Location> - </example> + <highlight language="config"> +# 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> + </highlight> </section> <section><title>Tracing another filter</title> - <example> - # Trace the data read and written by mod_deflate<br /> - # for a particular client (IP 192.168.1.31)<br /> - # experiencing compression problems.<br /> - # This filter will trace what goes into mod_deflate.<br /> - ExtFilterDefine tracebefore \<br /> - <indent> - cmd="/bin/tracefilter.pl /tmp/tracebefore" \<br /> - EnableEnv=trace_this_client<br /> - </indent> - <br /> - # This filter will trace what goes after mod_deflate.<br /> - # Note that without the ftype parameter, the default<br /> - # filter type of AP_FTYPE_RESOURCE would cause the<br /> - # filter to be placed *before* mod_deflate in the filter<br /> - # chain. Giving it a numeric value slightly higher than<br /> - # AP_FTYPE_CONTENT_SET will ensure that it is placed<br /> - # after mod_deflate.<br /> - ExtFilterDefine traceafter \<br /> - <indent> - cmd="/bin/tracefilter.pl /tmp/traceafter" \<br /> - EnableEnv=trace_this_client ftype=21<br /> - </indent> - <br /> - <Directory /usr/local/docs><br /> - <indent> - SetEnvIf Remote_Addr 192.168.1.31 trace_this_client<br /> - SetOutputFilter tracebefore;deflate;traceafter<br /> - </indent> - </Directory> - </example> + <highlight language="config"> +# 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> + </highlight> <example><title>Here is the filter which traces the data:</title> - #!/usr/local/bin/perl -w<br /> - use strict;<br /> - <br /> - open(SAVE, ">$ARGV[0]")<br /> - <indent> - or die "can't open $ARGV[0]: $?";<br /> - </indent> - <br /> - while (<STDIN>) {<br /> - <indent> - print SAVE $_;<br /> - print $_;<br /> - </indent> - }<br /> - <br /> - close(SAVE); + <highlight language="perl"> +#!/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); + </highlight> </example> </section> </section> <!-- /Examples --> @@ -326,9 +304,9 @@ delivery to the client</description> filter is removed and the request continues without it.</dd> </dl> - <example><title>Example</title> + <highlight language="config"> ExtFilterOptions LogStderr - </example> + </highlight> <p>Messages written to the filter's standard error will be stored in the Apache error log.</p>
|