From: Daniel Gruno
Date: Fri, 27 Apr 2012 05:42:24 +0000 (+0000)
Subject: Syntax updates for mod_s*.xml (sans mod_ssl.xml)
X-Git-Tag: 2.5.0-alpha~6990
X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77bd109be4aa9b9d05c6d2fe9c6f10081578e68f;p=thirdparty%2Fapache%2Fhttpd.git
Syntax updates for mod_s*.xml (sans mod_ssl.xml)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1331227 13f79535-47bb-0310-9956-ffa450edef68
---
diff --git a/docs/manual/mod/mod_sed.xml b/docs/manual/mod/mod_sed.xml
index 1a0c991ec27..639a909d5e2 100644
--- a/docs/manual/mod/mod_sed.xml
+++ b/docs/manual/mod/mod_sed.xml
@@ -62,33 +62,29 @@ the author's blog.
Sample Configuration
Adding an output filter
- # In the following example, the sed filter will change the string
- # "monday" to "MON" and the string "sunday" to SUN in html documents
- # before sending to the client.
-
- <Directory "/var/www/docs/sed">
-
- AddOutputFilter Sed html
- OutputSed "s/monday/MON/g"
- OutputSed "s/sunday/SUN/g"
-
- </Directory>
-
+
+# In the following example, the sed filter will change the string
+# "monday" to "MON" and the string "sunday" to SUN in html documents
+# before sending to the client.
+<Directory "/var/www/docs/sed">
+ AddOutputFilter Sed html
+ OutputSed "s/monday/MON/g"
+ OutputSed "s/sunday/SUN/g"
+</Directory>
+
Adding an input filter
- # In the following example, the sed filter will change the string
- # "monday" to "MON" and the string "sunday" to SUN in the POST data
- # sent to PHP.
-
- <Directory "/var/www/docs/sed">
-
- AddInputFilter Sed php
- InputSed "s/monday/MON/g"
- InputSed "s/sunday/SUN/g"
-
- </Directory>
-
+
+# In the following example, the sed filter will change the string
+# "monday" to "MON" and the string "sunday" to SUN in the POST data
+# sent to PHP.
+<Directory "/var/www/docs/sed">
+ AddInputFilter Sed php
+ InputSed "s/monday/MON/g"
+ InputSed "s/sunday/SUN/g"
+</Directory>
+
Sed Commands
diff --git a/docs/manual/mod/mod_session.xml b/docs/manual/mod/mod_session.xml
index 32c7c4fae66..963c0f0ccb2 100644
--- a/docs/manual/mod/mod_session.xml
+++ b/docs/manual/mod/mod_session.xml
@@ -131,8 +131,10 @@
stored on the browser, in a cookie called session.
Browser based session
- Session On
- SessionCookieName session path=/
+
+Session On
+SessionCookieName session path=/
+
The session is not useful unless it can be written to or read from. The
@@ -141,9 +143,11 @@
X-Replace-Session.
Writing to a session
- Session On
- SessionCookieName session path=/
- SessionHeader X-Replace-Session
+
+Session On
+SessionCookieName session path=/
+SessionHeader X-Replace-Session
+
The header should contain name value pairs expressed in the same format
@@ -151,11 +155,13 @@
empty string has the effect of removing that key from the session.
CGI to write to a session
- #!/bin/bash
- echo "Content-Type: text/plain"
- echo "X-Replace-Session: key1=foo&key2=&key3=bar"
- echo
- env
+
+#!/bin/bash
+echo "Content-Type: text/plain"
+echo "X-Replace-Session: key1=foo&key2=&key3=bar"
+echo
+env
+
If configured, the session can be read back from the HTTP_SESSION
@@ -164,10 +170,12 @@
SessionEnv directive.
Read from a session
- Session On
- SessionEnv On
- SessionCookieName session path=/
- SessionHeader X-Replace-Session
+
+Session On
+SessionEnv On
+SessionCookieName session path=/
+SessionHeader X-Replace-Session
+
Once read, the CGI variable HTTP_SESSION should contain
@@ -187,9 +195,11 @@
module.
Browser based encrypted session
- Session On
- SessionCryptoPassphrase secret
- SessionCookieName session path=/
+
+Session On
+SessionCryptoPassphrase secret
+SessionCookieName session path=/
+
The session will be automatically decrypted on load, and encrypted on
@@ -223,9 +233,11 @@
as in the example below.
Setting cookie parameters
- Session On
- SessionCryptoPassphrase secret
- SessionCookieName session path=/private;domain=example.com;httponly;secure;
+
+Session On
+SessionCryptoPassphrase secret
+SessionCookieName session path=/private;domain=example.com;httponly;secure;
+
In cases where the Apache server forms the frontend for backend origin servers,
@@ -244,14 +256,16 @@
the session.
Form based authentication
- Session On
- SessionCryptoPassphrase secret
- SessionCookieName session path=/
- AuthFormProvider file
- AuthUserFile conf/passwd
- AuthType form
- AuthName realm
- ...
+
+Session On
+SessionCryptoPassphrase secret
+SessionCookieName session path=/
+AuthFormProvider file
+AuthUserFile conf/passwd
+AuthType form
+AuthName realm
+#...
+
See the mod_auth_form module for documentation and complete
diff --git a/docs/manual/mod/mod_session_cookie.xml b/docs/manual/mod/mod_session_cookie.xml
index 5eadd4ffdb2..39a86b531c7 100644
--- a/docs/manual/mod/mod_session_cookie.xml
+++ b/docs/manual/mod/mod_session_cookie.xml
@@ -64,8 +64,10 @@
session, configure the session as follows:
Browser based session
- Session On
- SessionCookieName session path=/
+
+Session On
+SessionCookieName session path=/
+
For more examples on how the session can be configured to be read
@@ -100,8 +102,10 @@
Cookie with attributes
- Session On
- SessionCookieName session path=/private;domain=example.com;httponly;secure;version=1;
+
+Session On
+SessionCookieName session path=/private;domain=example.com;httponly;secure;version=1;
+
@@ -130,8 +134,10 @@
Cookie2 with attributes
- Session On
- SessionCookieName2 session path=/private;domain=example.com;httponly;secure;version=1;
+
+Session On
+SessionCookieName2 session path=/private;domain=example.com;httponly;secure;version=1;
+
diff --git a/docs/manual/mod/mod_session_crypto.xml b/docs/manual/mod/mod_session_crypto.xml
index 0edfd96fea9..1277dc75548 100644
--- a/docs/manual/mod/mod_session_crypto.xml
+++ b/docs/manual/mod/mod_session_crypto.xml
@@ -60,9 +60,11 @@
session, configure the session as follows:
Browser based encrypted session
- Session On
- SessionCookieName session path=/
- SessionCryptoPassphrase secret
+
+Session On
+SessionCookieName session path=/
+SessionCryptoPassphrase secret
+
The session will be encrypted with the given key. Different servers can
@@ -95,19 +97,27 @@
which are specified as parameters with optional values after the driver name.
NSS without a certificate database
+
SessionCryptoDriver nss
+
NSS with certificate database
+
SessionCryptoDriver nss dir=certs
+
NSS with certificate database and parameters
+
SessionCryptoDriver nss dir=certs key3=key3.db cert7=cert7.db secmod=secmod
+
NSS with paths containing spaces
+
SessionCryptoDriver nss "dir=My Certs" key3=key3.db cert7=cert7.db secmod=secmod
+
The NSS crypto driver might have already been configured by another
@@ -117,7 +127,9 @@
To avoid this warning, use the noinit parameter as follows.
NSS with certificate database
+
SessionCryptoDriver nss noinit
+
To prevent confusion, ensure that all modules requiring NSS are configured with
@@ -127,7 +139,9 @@
the engine to be used for encryption.
OpenSSL with engine support
+
SessionCryptoDriver openssl engine=name
+
diff --git a/docs/manual/mod/mod_session_dbd.xml b/docs/manual/mod/mod_session_dbd.xml
index b1663ed66ab..88cb809f3fd 100644
--- a/docs/manual/mod/mod_session_dbd.xml
+++ b/docs/manual/mod/mod_session_dbd.xml
@@ -73,13 +73,15 @@
session. These queries are configured as per the example below.
Sample DBD configuration
- DBDriver pgsql
- DBDParams "dbname=apachesession user=apache password=xxxxx host=localhost"
- DBDPrepareSQL "delete from session where key = %s" deletesession
- DBDPrepareSQL "update session set value = %s, expiry = %lld where key = %s" updatesession
- DBDPrepareSQL "insert into session (value, expiry, key) values (%s, %lld, %s)" insertsession
- DBDPrepareSQL "select value from session where key = %s and (expiry = 0 or expiry > %lld)" selectsession
- DBDPrepareSQL "delete from session where expiry != 0 and expiry < %lld" cleansession
+
+DBDriver pgsql
+DBDParams "dbname=apachesession user=apache password=xxxxx host=localhost"
+DBDPrepareSQL "delete from session where key = %s" deletesession
+DBDPrepareSQL "update session set value = %s, expiry = %lld where key = %s" updatesession
+DBDPrepareSQL "insert into session (value, expiry, key) values (%s, %lld, %s)" insertsession
+DBDPrepareSQL "select value from session where key = %s and (expiry = 0 or expiry > %lld)" selectsession
+DBDPrepareSQL "delete from session where expiry != 0 and expiry < %lld" cleansession
+
@@ -95,8 +97,10 @@
called session, configure the session as follows:
SQL based anonymous session
- Session On
- SessionDBDCookieName session path=/
+
+Session On
+SessionDBDCookieName session path=/
+
For more examples on how the session can be configured to be read
@@ -126,8 +130,10 @@
userid, configure the session as follows:
SQL based per user session
- Session On
- SessionDBDPerUser On
+
+Session On
+SessionDBDPerUser On
+
@@ -167,8 +173,10 @@
Cookie with attributes
- Session On
- SessionDBDCookieName session path=/private;domain=example.com;httponly;secure;version=1;
+
+Session On
+SessionDBDCookieName session path=/private;domain=example.com;httponly;secure;version=1;
+
@@ -197,8 +205,10 @@
Cookie2 with attributes
- Session On
- SessionDBDCookieName2 session path=/private;domain=example.com;httponly;secure;version=1;
+
+Session On
+SessionDBDCookieName2 session path=/private;domain=example.com;httponly;secure;version=1;
+
diff --git a/docs/manual/mod/mod_setenvif.xml b/docs/manual/mod/mod_setenvif.xml
index 9ff7ff404e8..a41641794e1 100644
--- a/docs/manual/mod/mod_setenvif.xml
+++ b/docs/manual/mod/mod_setenvif.xml
@@ -44,10 +44,10 @@ on characteristics of the request
such as this example, which sets netscape if the
browser is mozilla but not MSIE.
-
- BrowserMatch ^Mozilla netscape
- BrowserMatch MSIE !netscape
-
+
+BrowserMatch ^Mozilla netscape
+BrowserMatch MSIE !netscape
+
Environment Variables in Apache HTTP Server
@@ -69,17 +69,17 @@ on characteristics of the request
sets environment variables conditional on the
User-Agent HTTP request header. The following two
lines have the same effect:
-
- BrowserMatchNoCase Robot is_a_robot
- SetEnvIfNoCase User-Agent Robot is_a_robot
-
+
+BrowserMatchNoCase Robot is_a_robot
+SetEnvIfNoCase User-Agent Robot is_a_robot
+
Some additional examples:
-
- BrowserMatch ^Mozilla forms jpeg=yes browser=netscape
- BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript
- BrowserMatch MSIE !javascript
-
+
+BrowserMatch ^Mozilla forms jpeg=yes browser=netscape
+BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript
+BrowserMatch MSIE !javascript
+
@@ -101,20 +101,20 @@ respect to case
module="mod_setenvif">BrowserMatch directive.
However, it provides for case-insensitive matching. For
example:
-
- BrowserMatchNoCase mac platform=macintosh
- BrowserMatchNoCase win platform=windows
-
+
+BrowserMatchNoCase mac platform=macintosh
+BrowserMatchNoCase win platform=windows
+
The BrowserMatch and
BrowserMatchNoCase directives are special cases of
the SetEnvIf and SetEnvIfNoCase
directives. The following two lines have the same effect:
-
- BrowserMatchNoCase Robot is_a_robot
- SetEnvIfNoCase User-Agent Robot is_a_robot
-
+
+BrowserMatchNoCase Robot is_a_robot
+SetEnvIfNoCase User-Agent Robot is_a_robot
+
@@ -211,18 +211,17 @@ of
value and replace them by parenthesized subexpressions
of regex.
-
-Example:
- SetEnvIf Request_URI "\.gif$" object_is_image=gif
- SetEnvIf Request_URI "\.jpg$" object_is_image=jpg
- SetEnvIf Request_URI "\.xbm$" object_is_image=xbm
- :
- SetEnvIf Referer www\.mydomain\.example\.com intra_site_referral
- :
- SetEnvIf object_is_image xbm XBIT_PROCESSING=1
- :
- SetEnvIf ^TS ^[a-z] HAVE_TS
-
+
+SetEnvIf Request_URI "\.gif$" object_is_image=gif
+SetEnvIf Request_URI "\.jpg$" object_is_image=jpg
+SetEnvIf Request_URI "\.xbm$" object_is_image=xbm
+
+SetEnvIf Referer www\.mydomain\.example\.com intra_site_referral
+
+SetEnvIf object_is_image xbm XBIT_PROCESSING=1
+
+SetEnvIf ^TS ^[a-z] HAVE_TS
+
The first three will set the environment variable
object_is_image if the request was for an image
@@ -261,9 +260,9 @@ for additional examples.
and applied env-variable in the same fashion as SetEnvIf.
-
+
SetEnvIfExpr "tolower(req('X-Sendfile')) == 'd:\images\very_big.iso')" iso_delivered
-
+
This would set the environment variable iso_delivered
every time our application attempts to send it via X-Sendfile
@@ -271,9 +270,9 @@ for additional examples.
A more useful example would be to set the variable rfc1918 if the
remote IP address is a private address according to RFC 1918:
-
+
SetEnvIfExpr "-R '10.0.0.0/8' || -R '172.16.0.0/12' || -R '192.168.0.0/16'" rfc1918
-
+
Expressions in Apache HTTP Server,
@@ -301,9 +300,9 @@ without respect to case
the SetEnvIf directive,
and differs only in that the regular expression matching is
performed in a case-insensitive manner. For example:
-
+
SetEnvIfNoCase Host Example\.Org site=example
-
+
This will cause the site environment variable
to be set to "example" if the HTTP request header
diff --git a/docs/manual/mod/mod_so.xml b/docs/manual/mod/mod_so.xml
index cef79cb8dad..045cab33952 100644
--- a/docs/manual/mod/mod_so.xml
+++ b/docs/manual/mod/mod_so.xml
@@ -144,7 +144,7 @@ Windows
For example:
- LoadFile libexec/libxmlparse.so
+ LoadFile libexec/libxmlparse.so
@@ -167,9 +167,9 @@ of active modules
href="module-dict.html#ModuleIdentifier">Module Identifier
in the module documentation. Example:
-
+
LoadModule status_module modules/mod_status.so
-
+
loads the named module from the modules subdirectory of the
ServerRoot.
diff --git a/docs/manual/mod/mod_status.xml b/docs/manual/mod/mod_status.xml
index 20c7cc90499..12e94927b14 100644
--- a/docs/manual/mod/mod_status.xml
+++ b/docs/manual/mod/mod_status.xml
@@ -77,15 +77,12 @@ performance
To enable status reports only for browsers from the example.com
domain add this code to your httpd.conf
configuration file
-
- <Location /server-status>
-
- SetHandler server-status
-
- Require host example.com
-
- </Location>
-
+
+<Location /server-status>
+ SetHandler server-status
+ Require host example.com
+</Location>
+
You can now access server statistics by using a Web browser
to access the page
diff --git a/docs/manual/mod/mod_substitute.xml b/docs/manual/mod/mod_substitute.xml
index 0e0ab41e48e..3c275decad5 100644
--- a/docs/manual/mod/mod_substitute.xml
+++ b/docs/manual/mod/mod_substitute.xml
@@ -71,36 +71,36 @@
Example
- <Location />
-
- AddOutputFilterByType SUBSTITUTE text/html
- Substitute s/foo/bar/ni
-
- </Location>
+
+<Location />
+ AddOutputFilterByType SUBSTITUTE text/html
+ Substitute s/foo/bar/ni
+</Location>
+
If either the pattern or the substitution contain a slash
character then an alternative delimiter should be used:
Example of using an alternate delimiter
- <Location />
-
- AddOutputFilterByType SUBSTITUTE text/html
- Substitute "s|<BR */?>|<br />|i"
-
- </Location>
+
+<Location />
+ AddOutputFilterByType SUBSTITUTE text/html
+ Substitute "s|<BR */?>|<br />|i"
+</Location>
+
Backreferences can be used in the comparison and in the substitution,
when regular expressions are used, as illustrated in the following example:
Example of using backreferences and captures
- <Location />
-
- AddOutputFilterByType SUBSTITUTE text/html
- # "foo=k,bar=k" -> "foo/bar=k"
- Substitute "s|foo=(\w+),bar=\1|foo/bar=$1"
-
- </Location>
+
+<Location />
+ AddOutputFilterByType SUBSTITUTE text/html
+ # "foo=k,bar=k" -> "foo/bar=k"
+ Substitute "s|foo=(\w+),bar=\1|foo/bar=$1"
+</Location>
+
A common use scenario for mod_substitute is the
@@ -113,10 +113,12 @@
those URLs into something that will work from the front end:
Rewriting URLs embedded in proxied content
- ProxyPass /blog/ http://internal.blog.example.com
- ProxyPassReverse /blog/ http://internal.blog.example.com/
-
- Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i"
+
+ProxyPass /blog/ http://internal.blog.example.com
+ProxyPassReverse /blog/ http://internal.blog.example.com/
+
+Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i"
+
ProxyPassReverse
diff --git a/docs/manual/mod/mod_suexec.xml b/docs/manual/mod/mod_suexec.xml
index f2d3ce0d788..2a8232b25cd 100644
--- a/docs/manual/mod/mod_suexec.xml
+++ b/docs/manual/mod/mod_suexec.xml
@@ -57,7 +57,9 @@ later.
Example
+
SuexecUserGroup nobody nogroup
+
In Apache httpd 2.3.9 and later, startup will fail if this