From e618c6e4490c9dc5c84154080ff697cf7e79f175 Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Fri, 4 May 2012 15:30:48 +0000 Subject: [PATCH] Backporting syntax highlighting (and a few typo fixes) for base directory files git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1334033 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/bind.xml | 32 ++-- docs/manual/caching.xml | 18 +-- docs/manual/content-negotiation.xml | 10 +- docs/manual/custom-error.xml | 22 +-- docs/manual/dns-caveats.xml | 67 ++++----- docs/manual/env.xml | 88 ++++++----- docs/manual/expr.xml | 40 +++-- docs/manual/filter.xml | 1 + docs/manual/glossary.xml | 2 +- docs/manual/handler.xml | 22 +-- docs/manual/install.xml | 4 +- docs/manual/logs.xml | 96 ++++++------ docs/manual/sections.xml | 220 ++++++++++++++-------------- docs/manual/socache.xml | 1 + docs/manual/suexec.xml | 10 +- docs/manual/upgrading.xml | 32 ++-- docs/manual/urlmapping.xml | 37 +++-- 17 files changed, 350 insertions(+), 352 deletions(-) diff --git a/docs/manual/bind.xml b/docs/manual/bind.xml index b74c53a0bd..9d3a31aea2 100644 --- a/docs/manual/bind.xml +++ b/docs/manual/bind.xml @@ -71,25 +71,25 @@

For example, to make the server accept connections on both port 80 and port 8000, on all interfaces, use:

- - Listen 80
- Listen 8000 -
+ +Listen 80 +Listen 8000 +

To make the server accept connections on port 80 for one interface, and port 8000 on another, use

- - Listen 192.0.2.1:80
- Listen 192.0.2.5:8000 -
+ +Listen 192.0.2.1:80 +Listen 192.0.2.5:8000 +

IPv6 addresses must be enclosed in square brackets, as in the following example:

- + Listen [2001:db8::a00:20ff:fea7:ccea]:80 - +

Overlapping Listen directives will result in a @@ -136,10 +136,10 @@ Listen directives, as in the following examples:

- - Listen 0.0.0.0:80
- Listen 192.0.2.1:80 -
+ +Listen 0.0.0.0:80 +Listen 192.0.2.1:80 +

If your platform supports it and you want httpd to handle IPv4 and IPv6 connections on separate sockets (i.e., to disable IPv4-mapped @@ -162,9 +162,9 @@

You only need to set the protocol if you are running on non-standard ports. For example, running an https site on port 8443:

- + Listen 192.170.2.1:8443 https - +
diff --git a/docs/manual/caching.xml b/docs/manual/caching.xml index 66c0055692..5fc8ab9616 100644 --- a/docs/manual/caching.xml +++ b/docs/manual/caching.xml @@ -430,12 +430,12 @@ Vary: negotiate,accept-language,accept-charset

Typically the module will be configured as so;

- -CacheRoot /var/cache/apache/
-CacheEnable disk /
-CacheDirLevels 2
+ +CacheRoot "/var/cache/apache/" +CacheEnable disk / +CacheDirLevels 2 CacheDirLength 1 -
+

Importantly, as the cached files are locally stored, operating system in-memory caching will typically be applied to their access also. So @@ -663,9 +663,9 @@ CacheDirLength 1 instructs httpd to open the file when it is started and to re-use this file-handle for all subsequent access to this file.

- + CacheFile /usr/local/apache2/htdocs/index.html - +

If you intend to cache a large number of files in this manner, you must ensure that your operating system's limit for the number of open @@ -755,9 +755,9 @@ sys 0m0.000s start time (using the mmap system call). httpd will use the in-memory contents for all subsequent accesses to this file.

- + MMapFile /usr/local/apache2/htdocs/index.html - +

As with the CacheFile directive, any diff --git a/docs/manual/content-negotiation.xml b/docs/manual/content-negotiation.xml index 2076152d20..fbd70a00f9 100644 --- a/docs/manual/content-negotiation.xml +++ b/docs/manual/content-negotiation.xml @@ -120,7 +120,7 @@ defines a file suffix as type-map; this is best done with

-AddHandler type-map .var +AddHandler type-map .var

in the server configuration file.

@@ -223,7 +223,7 @@ module="mod_dir">DirectoryIndex directive, if the server is trying to index a directory. If the configuration files specify

-DirectoryIndex index +DirectoryIndex index

then the server will arbitrate between index.html and index.html3 if both are present. If neither are present, and index.cgi is there, the server @@ -512,8 +512,10 @@ the normal negotiation process applies.

Example - SetEnvIf Cookie "language=(.+)" prefer-language=$1
- Header append Vary cookie + +SetEnvIf Cookie "language=(.+)" prefer-language=$1 +Header append Vary cookie +
diff --git a/docs/manual/custom-error.xml b/docs/manual/custom-error.xml index 083928b7e2..da6159396d 100644 --- a/docs/manual/custom-error.xml +++ b/docs/manual/custom-error.xml @@ -55,19 +55,19 @@ if AllowOverride is set to FileInfo.

- - ErrorDocument 500 "Sorry, our script crashed. Oh dear"
- ErrorDocument 500 /cgi-bin/crash-recover
- ErrorDocument 500 http://error.example.com/server_error.html
- ErrorDocument 404 /errors/not_found.html
- ErrorDocument 401 /subscription/how_to_subscribe.html -
+ +ErrorDocument 500 "Sorry, our script crashed. Oh dear"
+ErrorDocument 500 /cgi-bin/crash-recover
+ErrorDocument 500 http://error.example.com/server_error.html
+ErrorDocument 404 /errors/not_found.html
+ErrorDocument 401 /subscription/how_to_subscribe.html +

The syntax of the ErrorDocument directive is:

- + ErrorDocument <3-digit-code> <action> - +

where the action will be treated as:

@@ -96,7 +96,7 @@ 'REDIRECT_' onto the original header name. This provides the error document the context of the original request.

-

For example, you might recieve, in addition to more usual +

For example, you might receive, in addition to more usual environment variables, the following.

@@ -135,7 +135,7 @@

If you point your ErrorDocument to some variety of dynamic handler such as a server-side include document, CGI script, or some variety of other handler, you may wish to use the - available custom environent variables to customize this + available custom environment variables to customize this response.

If the ErrorDocument specifies a local redirect to a CGI diff --git a/docs/manual/dns-caveats.xml b/docs/manual/dns-caveats.xml index c715450f10..2ff924b102 100644 --- a/docs/manual/dns-caveats.xml +++ b/docs/manual/dns-caveats.xml @@ -37,13 +37,13 @@

A Simple Example - - # This is a misconfiguration example, do not use on your server
- <VirtualHost www.example.dom>
- ServerAdmin webgirl@example.dom
- DocumentRoot /www/example
- </VirtualHost> -
+ +# This is a misconfiguration example, do not use on your server +<VirtualHost www.example.dom> + ServerAdmin webgirl@example.dom + DocumentRoot /www/example +</VirtualHost> +

In order for the server to function properly, it absolutely needs to have two pieces of information about each virtual host: the @@ -59,13 +59,13 @@

Suppose that www.example.dom has address 192.0.2.1. Then consider this configuration snippet:

- - # This is a misconfiguration example, do not use on your server
- <VirtualHost 192.0.2.1>
- ServerAdmin webgirl@example.dom
- DocumentRoot /www/example
- </VirtualHost> -
+ +# This is a misconfiguration example, do not use on your server +<VirtualHost 192.0.2.1> + ServerAdmin webgirl@example.dom + DocumentRoot /www/example +</VirtualHost> +

This time httpd needs to use reverse DNS to find the ServerName for this virtualhost. If that reverse @@ -78,13 +78,13 @@

Here is a snippet that avoids both of these problems:

- - <VirtualHost 192.0.2.1>
- ServerName www.example.dom
- ServerAdmin webgirl@example.dom
- DocumentRoot /www/example
- </VirtualHost> -
+ +<VirtualHost 192.0.2.1> + ServerName www.example.dom + ServerAdmin webgirl@example.dom + DocumentRoot /www/example +</VirtualHost> +
@@ -92,21 +92,16 @@

Consider this configuration snippet:

- - <VirtualHost www.example1.dom>
- - ServerAdmin webgirl@example1.dom
- DocumentRoot /www/example1
-
- </VirtualHost>
-
- <VirtualHost www.example2.dom>
- - ServerAdmin webguy@example2.dom
- DocumentRoot /www/example2
-
- </VirtualHost> -
+ +<VirtualHost www.example1.dom> + ServerAdmin webgirl@example1.dom + DocumentRoot /www/example1 +</VirtualHost> +<VirtualHost www.example2.dom> + ServerAdmin webguy@example2.dom + DocumentRoot /www/example2 +</VirtualHost> +

Suppose that you've assigned 192.0.2.1 to www.example1.dom and 192.0.2.2 to diff --git a/docs/manual/env.xml b/docs/manual/env.xml index 3c3a902caf..513050d4dc 100644 --- a/docs/manual/env.xml +++ b/docs/manual/env.xml @@ -446,14 +446,14 @@ and mod_header allows you to still accept these headers:

- -#
-# The following works around a client sending a broken Accept_Encoding
-# header.
-#
-SetEnvIfNoCase ^Accept.Encoding$ ^(.*)$ fix_accept_encoding=$1
+ +# +# The following works around a client sending a broken Accept_Encoding +# header. +# +SetEnvIfNoCase ^Accept.Encoding$ ^(.*)$ fix_accept_encoding=$1 RequestHeader set Accept-Encoding %{fix_accept_encoding}e env=fix_accept_encoding -
+
@@ -464,27 +464,27 @@ RequestHeader set Accept-Encoding %{fix_accept_encoding}e env=fix_accept_encodin httpd.conf to deal with known client problems. Since the affected clients are no longer seen in the wild, this configuration is likely no-longer necessary.

- -#
-# The following directives modify normal HTTP response behavior.
-# The first directive disables keepalive for Netscape 2.x and browsers that
-# spoof it. There are known problems with these browser implementations.
-# The second directive is for Microsoft Internet Explorer 4.0b2
-# which has a broken HTTP/1.1 implementation and does not properly
-# support keepalive when it is used on 301 or 302 (redirect) responses.
-#
-BrowserMatch "Mozilla/2" nokeepalive
-BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
-
-#
-# The following directive disables HTTP/1.1 responses to browsers which
-# are in violation of the HTTP/1.0 spec by not being able to understand a
-# basic 1.1 response.
-#
-BrowserMatch "RealPlayer 4\.0" force-response-1.0
-BrowserMatch "Java/1\.0" force-response-1.0
+ +# +# The following directives modify normal HTTP response behavior. +# The first directive disables keepalive for Netscape 2.x and browsers that +# spoof it. There are known problems with these browser implementations. +# The second directive is for Microsoft Internet Explorer 4.0b2 +# which has a broken HTTP/1.1 implementation and does not properly +# support keepalive when it is used on 301 or 302 (redirect) responses. +# +BrowserMatch "Mozilla/2" nokeepalive +BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 + +# +# The following directive disables HTTP/1.1 responses to browsers which +# are in violation of the HTTP/1.0 spec by not being able to understand a +# basic 1.1 response. +# +BrowserMatch "RealPlayer 4\.0" force-response-1.0 +BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 -
+
@@ -495,12 +495,12 @@ BrowserMatch "JDK/1\.0" force-response-1.0 particular directories, or to prevent logging of requests coming from particular hosts.

- - SetEnvIf Request_URI \.gif image-request
- SetEnvIf Request_URI \.jpg image-request
- SetEnvIf Request_URI \.png image-request
- CustomLog logs/access_log common env=!image-request -
+ +SetEnvIf Request_URI \.gif image-request +SetEnvIf Request_URI \.jpg image-request +SetEnvIf Request_URI \.png image-request +CustomLog logs/access_log common env=!image-request +
@@ -512,18 +512,16 @@ BrowserMatch "JDK/1\.0" force-response-1.0 in limited circumstances. We assume that all your images are in a directory called /web/images.

- - SetEnvIf Referer "^http://www\.example\.com/" local_referal
- # Allow browsers that do not send Referer info
- SetEnvIf Referer "^$" local_referal
- <Directory /web/images>
- - Order Deny,Allow
- Deny from all
- Allow from env=local_referal -
- </Directory> -
+ +SetEnvIf Referer "^http://www\.example\.com/" local_referal +# Allow browsers that do not send Referer info +SetEnvIf Referer "^$" local_referal +<Directory /web/images> + Order Deny,Allow + Deny from all + Allow from env=local_referal +</Directory> +

For more information about this technique, see the "mod_include

- Grammar in Backus–Naur Form notation -

Backus–Naur Form (BNF) is a notation + Grammar in Backus-Naur Form notation +

Backus-Naur Form (BNF) is a notation technique for context-free grammars, often used to describe the syntax of languages used in computing.

@@ -476,26 +476,22 @@ listfunction ::= listfuncname "(" word ")" Example expressions

The following examples show how expressions might be used to evaluate requests:

- - # Compare the host name to example.com and redirect to www.example.com if it matches
- <If "%{HTTP_HOST} == 'example.com'">
- - Redirect permanent / http://www.example.com
-
- </If>

- # Force text/plain if requesting a file with the query string contains 'forcetext'
- <If "%{QUERY_STRING} =~ /forcetext/">
- - ForceType text/plain
-
- </If>

- # Only allow access to this content during business hours
- <Directory "/foo/bar/business">
- - Require expr %{TIME_HOUR} >= 9 && %{TIME_HOUR} <= 17
-
- </Directory> -
+ +# Compare the host name to example.com and redirect to www.example.com if it matches +<If "%{HTTP_HOST} == 'example.com'"> + Redirect permanent / http://www.example.com +</If> + +# Force text/plain if requesting a file with the query string contains 'forcetext' +<If "%{QUERY_STRING} =~ /forcetext/"> + ForceType text/plain +</If> + +# Only allow access to this content during business hours +<Directory "/foo/bar/business"> + Require expr %{TIME_HOUR} >= 9 && %{TIME_HOUR} <= 17 +</Directory> +
diff --git a/docs/manual/filter.xml b/docs/manual/filter.xml index d59b776d3c..1b97cc5adf 100644 --- a/docs/manual/filter.xml +++ b/docs/manual/filter.xml @@ -47,6 +47,7 @@ mod_substitute mod_xml2enc mod_proxy_html + mod_policy FilterChain diff --git a/docs/manual/glossary.xml b/docs/manual/glossary.xml index 3bc7dae09e..b236d99f43 100644 --- a/docs/manual/glossary.xml +++ b/docs/manual/glossary.xml @@ -382,7 +382,7 @@ be written as "/images/.*(jpg|gif)$". In places where regular expressions are used to replace strings, the special variables $1 ... $9 contain backreferences to the grouped parts (in parentheses) of - the matched expression. The special variable $0 contains a backerference + the matched expression. The special variable $0 contains a backreference to the whole matched expression. To write a literal dollar sign in a replacement string, it can be escaped with a backslash. Historically, the variable & could be used as alias for $0 in some places. This is no diff --git a/docs/manual/handler.xml b/docs/manual/handler.xml index 08a59ea4dd..98dc9599bf 100644 --- a/docs/manual/handler.xml +++ b/docs/manual/handler.xml @@ -105,10 +105,10 @@ the html extension to trigger the launch of the footer.pl CGI script.

- - Action add-footer /cgi-bin/footer.pl
- AddHandler add-footer .html -
+ +Action add-footer /cgi-bin/footer.pl +AddHandler add-footer .html +

Then the CGI script is responsible for sending the originally requested document (pointed to by the @@ -126,11 +126,11 @@ the send-as-is handler, regardless of their filename extensions.

- - <Directory /web/htdocs/asis>
- SetHandler send-as-is
- </Directory> -
+ +<Directory /web/htdocs/asis> + SetHandler send-as-is +</Directory> +
@@ -142,9 +142,9 @@ you may wish to make use of. Specifically, a new record has been added to the request_rec structure:

- + char *handler - +

If you wish to have your module engage a handler, you need only to set r->handler to the name of the diff --git a/docs/manual/install.xml b/docs/manual/install.xml index 52ea6f71f0..630d64e664 100644 --- a/docs/manual/install.xml +++ b/docs/manual/install.xml @@ -138,7 +138,7 @@ you may have to install the corresponding -dev package to allow httpd to build against your installed copy of PCRE. - +

Disk Space
Make sure you have at least 50 MB of temporary free disk space available. After installation the server occupies @@ -364,7 +364,7 @@ $ tar xvf httpd-NN.tar major releases (for example, from 2.0 to 2.2 or from 2.2 to 2.3), there will likely be major differences in the compile-time and run-time configuration that will require manual adjustments. All - modules will also need to be upgraded to accomodate changes in the + modules will also need to be upgraded to accommodate changes in the module API.

Upgrading from one minor version to the next (for example, from diff --git a/docs/manual/logs.xml b/docs/manual/logs.xml index 682858327b..2c94dd20f1 100644 --- a/docs/manual/logs.xml +++ b/docs/manual/logs.xml @@ -167,9 +167,9 @@

Do this by specifying the name of the module in your LogLevel directive:

- + LogLevel info rewrite:trace5 - +

This sets the main LogLevel to info, but turns it up to trace5 for @@ -235,10 +235,10 @@

A typical configuration for the access log might look as follows.

- - LogFormat "%h %l %u %t \"%r\" %>s %b" common
- CustomLog logs/access_log common -
+ +LogFormat "%h %l %u %t \"%r\" %>s %b" common +CustomLog logs/access_log common +

This defines the nickname common and associates it with a particular log format string. The format @@ -381,11 +381,10 @@

Another commonly used format string is called the Combined Log Format. It can be used as follows.

- - LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" - \"%{User-agent}i\"" combined
- CustomLog log/access_log combined -
+ +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined +CustomLog log/access_log combined +

This format is exactly the same as the Common Log Format, with the addition of two more fields. Each of the additional @@ -435,12 +434,12 @@ to mimic the effects of the ReferLog and AgentLog directives.

- - LogFormat "%h %l %u %t \"%r\" %>s %b" common
- CustomLog logs/access_log common
- CustomLog logs/referer_log "%{Referer}i -> %U"
- CustomLog logs/agent_log "%{User-agent}i" -
+ +LogFormat "%h %l %u %t \"%r\" %>s %b" common +CustomLog logs/access_log common +CustomLog logs/referer_log "%{Referer}i -> %U" +CustomLog logs/agent_log "%{User-agent}i" +

This example also shows that it is not necessary to define a nickname with the - - # Mark requests from the loop-back interface
- SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
- # Mark requests for the robots.txt file
- SetEnvIf Request_URI "^/robots\.txt$" dontlog
- # Log what remains
- CustomLog logs/access_log common env=!dontlog -
+ +# Mark requests from the loop-back interface +SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog +# Mark requests for the robots.txt file +SetEnvIf Request_URI "^/robots\.txt$" dontlog +# Log what remains +CustomLog logs/access_log common env=!dontlog +

As another example, consider logging requests from english-speakers to one log file, and non-english speakers to a different log file.

- + SetEnvIf Accept-Language "en" english
CustomLog logs/english_log common env=english
CustomLog logs/non_english_log common env=!english -
+

In a caching scenario one would want to know about the efficiency of the cache. A very simple method to find this out would be:

- - SetEnv CACHE_MISS 1
- LogFormat "%h %l %u %t "%r " %>s %b %{CACHE_MISS}e" common-cache
- CustomLog logs/access_log common-cache -
+ +SetEnv CACHE_MISS 1 +LogFormat "%h %l %u %t "%r " %>s %b %{CACHE_MISS}e" common-cache +CustomLog logs/access_log common-cache +

mod_cache will run before mod_env and when successfull will deliver the @@ -502,10 +501,10 @@ module="mod_log_config">LogFormat supports logging values conditional upon the HTTP response code:

- - LogFormat "%400,501{User-agent}i" browserlog
- LogFormat "%!200,304,302{Referer}i" refererlog -
+ +LogFormat "%400,501{User-agent}i" browserlog +LogFormat "%!200,304,302{Referer}i" refererlog +

In the first example, the User-agent will be logged if the HTTP status code is 400 or 501. In other cases, a @@ -586,10 +585,9 @@ for this purpose. For example, to rotate the logs every 24 hours, you can use:

- - CustomLog "|/usr/local/apache/bin/rotatelogs - /var/log/access_log 86400" common - + + CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" common +

Notice that quotes are used to enclose the entire command that will be called for the pipe. Although these examples are @@ -608,11 +606,10 @@ a shell. Use "|$" instead of "|" to spawn using a shell (usually with /bin/sh -c):

- - # Invoke "rotatelogs" using a shell
- CustomLog "|$/usr/local/apache/bin/rotatelogs - /var/log/access_log 86400" common -
+ +# Invoke "rotatelogs" using a shell +CustomLog "|$/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" common +

This was the default behaviour for Apache 2.2. Depending on the shell specifics this might lead to @@ -657,11 +654,10 @@ later split the log into individual files. For example, consider the following directives.

- - LogFormat "%v %l %u %t \"%r\" %>s %b" - comonvhost
- CustomLog logs/access_log comonvhost -
+ +LogFormat "%v %l %u %t \"%r\" %>s %b" comonvhost +CustomLog logs/access_log comonvhost +

The %v is used to log the name of the virtual host that is serving the request. Then a program like httpd -DClosedForNow:

- -<IfDefine ClosedForNow>
-Redirect / http://otherserver.example.com/
+ +<IfDefine ClosedForNow> + Redirect / http://otherserver.example.com/ </IfDefine> -
+

The IfModule directive is very similar, except it encloses directives that will @@ -97,11 +97,11 @@ about missing modules.

module="mod_mime_magic">MimeMagicFile directive will be applied only if mod_mime_magic is available.

- -<IfModule mod_mime_magic.c>
-MimeMagicFile conf/magic
+ +<IfModule mod_mime_magic.c> + MimeMagicFile conf/magic </IfModule> -
+

The IfVersion directive is very similar to - - <IfVersion >= 2.1>
- - # this happens only in versions greater or
- # equal 2.1.0.
-
+ + <IfVersion >= 2.1> + # this happens only in versions greater or + # equal 2.1.0. </IfVersion> -
+

IfDefine, IfModule, and the @@ -162,11 +160,11 @@ href="howto/htaccess.html">.htaccess files. For example, in the following configuration, directory indexes will be enabled for the /var/web/dir1 directory and all subdirectories.

- -<Directory /var/web/dir1>
-Options +Indexes
+ +<Directory /var/web/dir1> + Options +Indexes </Directory> -
+

Directives enclosed in a Files section apply to any file with @@ -176,12 +174,12 @@ when placed in the main section of the configuration file, deny access to any file named private.html regardless of where it is found.

- -<Files private.html>
-Order allow,deny
-Deny from all
+ +<Files private.html> + Order allow,deny + Deny from all </Files> -
+

To address files found in a particular part of the filesystem, the Files and @@ -193,14 +191,14 @@ access to /var/web/dir1/private.html, of private.html found under the /var/web/dir1/ directory.

- -<Directory /var/web/dir1>
-<Files private.html>
-Order allow,deny
-Deny from all
-</Files>
+ +<Directory /var/web/dir1> + <Files private.html> + Order allow,deny + Deny from all + </Files> </Directory> -
+
Webspace Containers @@ -216,12 +214,12 @@ In particular, it will apply to requests for http://yoursite.example.com/private/dir/file.html as well as any other requests starting with the /private string.

- -<LocationMatch ^/private>
-Order Allow,Deny
-Deny from all
+ +<LocationMatch ^/private> + Order Allow,Deny + Deny from all </Location> -
+

The Location directive need not have anything to do with the filesystem. @@ -230,35 +228,35 @@ URL to an internal Apache HTTP Server handler provided by mod_statusserver-status needs to exist in the filesystem.

- -<Location /server-status>
-SetHandler server-status
+ +<Location /server-status> + SetHandler server-status </Location> -
+
Overlapping Webspace

In order to have two overlapping URLs one has to consider the order in which certain sections or directives are evaluated. For Location this would be:

- -<Location /foo>
-</Location>
-<Location /foo/bar>
+ +<Location /foo> +</Location> +<Location /foo/bar> </Location> -
+

Aliases on the other hand, are mapped vice-versa:

- -Alias /foo/bar /srv/www/uncommon/bar
-Alias /foo /srv/www/common/foo
-
+ +Alias /foo/bar /srv/www/uncommon/bar +Alias /foo /srv/www/common/foo +

The same is true for the ProxyPass directives:

- -ProxyPass /special-area http://special.example.com smax=5 max=10
+ +ProxyPass /special-area http://special.example.com smax=5 max=10 ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On -
+
Wildcards and Regular Expressions @@ -287,20 +285,20 @@ how directives are applied.

A non-regex wildcard section that changes the configuration of all user directories could look as follows:

- -<Directory /home/*/public_html>
-Options Indexes
+ +<Directory /home/*/public_html> + Options Indexes </Directory> -
+

Using regex sections, we can deny access to many types of image files at once:

- -<FilesMatch \.(?i:gif|jpe?g|png)$>
-Order allow,deny
-Deny from all
+ +<FilesMatch \.(?i:gif|jpe?g|png)$> + Order allow,deny + Deny from all </FilesMatch> -
+
@@ -310,11 +308,11 @@ directive change the configuration depending on a condition which can be expressed by a boolean expression. For example, the following configuration denies access if the HTTP Referer header does not start with "http://www.example.com/".

- -<If "!(%{HTTP_REFERER} -strmatch 'http://www.example.com/*')">
-Require all denied
+ +<If "!(%{HTTP_REFERER} -strmatch 'http://www.example.com/*')"> + Require all denied </If> -
+ @@ -336,12 +334,12 @@ different webspace locations (URLs) could map to the same filesystem location, allowing your restrictions to be circumvented. For example, consider the following configuration:

- -<Location /dir/>
-Order allow,deny
-Deny from all
+ +<Location /dir/> + Order allow,deny + Deny from all </Location> -
+

This works fine if the request is for http://yoursite.example.com/dir/. But what if you are on @@ -404,12 +402,12 @@ that match the specified URL. For example, the following configuration will prevent the proxy server from being used to access the www.example.com website.

- -<Proxy http://www.example.com/*>
-Order allow,deny
-Deny from all
+ +<Proxy http://www.example.com/*> + Order allow,deny + Deny from all </Proxy> -
+
What Directives are Allowed? @@ -530,30 +528,30 @@ merging. Assuming they all apply to the request, the directives in this example will be applied in the order A > B > C > D > E.

- -<Location />
-E
-</Location>
-
-<Files f.html>
-D
-</Files>
-
-<VirtualHost *>
-<Directory /a/b>
-B
-</Directory>
-</VirtualHost>
-
-<DirectoryMatch "^.*b$">
-C
-</DirectoryMatch>
-
-<Directory /a/b>
-A
-</Directory>
-
-
+ +<Location /> + E +</Location> + +<Files f.html> + D +</Files> + +<VirtualHost *> +<Directory /a/b> + B +</Directory> +</VirtualHost> + +<DirectoryMatch "^.*b$"> + C +</DirectoryMatch> + +<Directory /a/b> + A +</Directory> + +

For a more concrete example, consider the following. Regardless of any access restrictions placed in Location section will be evaluated last and will allow unrestricted access to the server. In other words, order of merging is important, so be careful!

- -<Location />
-Order deny,allow
-Allow from all
-</Location>
-
-# Woops! This <Directory> section will have no effect
-<Directory />
-Order allow,deny
-Allow from all
-Deny from badguy.example.com
+ +<Location /> + Order deny,allow + Allow from all +</Location> + +# Woops! This <Directory> section will have no effect +<Directory /> + Order allow,deny + Allow from all + Deny from badguy.example.com </Directory> -
+
diff --git a/docs/manual/socache.xml b/docs/manual/socache.xml index c680379256..70daaa2614 100644 --- a/docs/manual/socache.xml +++ b/docs/manual/socache.xml @@ -40,6 +40,7 @@

The only configuration required is to select which cache provider to use. This is the responsibility of modules using the cache, and they enable selection using directives such as + CacheSocache, AuthnCacheSOCache, SSLSessionCache, and SSLStaplingCache.

diff --git a/docs/manual/suexec.xml b/docs/manual/suexec.xml index 737e18f56e..f78f598f3c 100644 --- a/docs/manual/suexec.xml +++ b/docs/manual/suexec.xml @@ -239,7 +239,7 @@

If it doesn't exist, it can't very well contain files. If we - can't change directory to it, it might aswell not exist. + can't change directory to it, it might as well not exist.

@@ -466,10 +466,10 @@

If for example, your web server is configured to run as:

- - User www
- Group webgroup
-
+ +User www +Group webgroup +

and suexec is installed at "/usr/local/apache2/bin/suexec", you should run:

diff --git a/docs/manual/upgrading.xml b/docs/manual/upgrading.xml index 3cf308b802..aff4fb1086 100644 --- a/docs/manual/upgrading.xml +++ b/docs/manual/upgrading.xml @@ -84,12 +84,6 @@
  • configure: the "reallyall" module set adds developer modules to the "all" set
  • - -
  • apr and apr-util: APR and APR-Util are no longer bundled with - Apache httpd 2.4. You can either use already installed versions or - continue to use --with-included-apr after downloading - (from Apache APR) and unpacking - apr/apr-util into ./srclib/
  • @@ -136,23 +130,31 @@

    In this example, all requests are denied.

    2.2 configuration: - Order deny,allow
    - Deny from all + +Order deny,allow +Deny from all +
    2.4 configuration: + Require all denied +

    In this example, all requests are allowed.

    2.2 configuration: - Order allow,deny
    - Allow from all + +Order allow,deny +Allow from all +
    2.4 configuration: + Require all granted +

    In the following example, all hosts in the example.org domain @@ -160,13 +162,17 @@ 2.2 configuration: - Order Deny,Allow
    - Deny from all
    - Allow from example.org + +Order Deny,Allow +Deny from all +Allow from example.org +
    2.4 configuration: + Require host example.org + diff --git a/docs/manual/urlmapping.xml b/docs/manual/urlmapping.xml index 5d46fd9d9f..9674602fd0 100644 --- a/docs/manual/urlmapping.xml +++ b/docs/manual/urlmapping.xml @@ -118,7 +118,7 @@ module="mod_alias">Alias directive will map any part of the filesystem into the web space. For example, with

    -Alias /docs /var/web +Alias /docs /var/web

    the URL http://www.example.com/docs/dir/file.html will be served from /var/web/dir/file.html. The @@ -134,8 +134,9 @@ expression based matching and substitution. For example,

    -ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+) - /home/$1/cgi-bin/$2 + + ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+) /home/$1/cgi-bin/$2 +

    will map a request to http://example.com/~user/cgi-bin/script.cgi to the @@ -181,8 +182,9 @@ /home/user/public_html/file.html, use the following AliasMatch directive:

    -AliasMatch ^/upages/([a-zA-Z0-9]+)(/(.*))?$ - /home/$1/public_html/$3 + + AliasMatch ^/upages/([a-zA-Z0-9]+)(/(.*))?$ /home/$1/public_html/$3 +
    URL Redirection @@ -200,8 +202,9 @@ to the new directory /bar/, you can instruct clients to request the content at the new location as follows:

    -Redirect permanent /foo/ - http://www.example.com/bar/ + + Redirect permanent /foo/ http://www.example.com/bar/ +

    This will redirect any URL-Path starting in /foo/ to the same URL path on the @@ -215,14 +218,16 @@ for the site home page to a different site, but leave all other requests alone, use the following configuration:

    -RedirectMatch permanent ^/$ - http://www.example.com/startpage.html + + RedirectMatch permanent ^/$ http://www.example.com/startpage.html +

    Alternatively, to temporarily redirect all pages on one site to a particular page on another site, use the following:

    -RedirectMatch temp .* - http://othersite.example.com/startpage.html + + RedirectMatch temp .* http://othersite.example.com/startpage.html +
    Reverse Proxy @@ -240,12 +245,12 @@ the /bar/ directory on internal.example.com and returns them to the client as if they were from the local server.

    - + ProxyPass /foo/ http://internal.example.com/bar/
    ProxyPassReverse /foo/ http://internal.example.com/bar/
    ProxyPassReverseCookieDomain internal.example.com public.example.com
    ProxyPassReverseCookiePath /foo/ /bar/ -
    +

    The ProxyPass configures the server to fetch the appropriate documents, while the @@ -264,11 +269,11 @@ breaking out of the proxy server and requesting directly from content) in a page as it is being served to the client using mod_substitute.

    - + Substitute s/internal\.example\.com/www.example.com/i - + -

    For more sophisticated rewriting of links in HTML and XHTML, the +

    For more sophisticated rewriting of links in HTML and XHTML, the mod_proxy_html module is also available. It allows you to create maps of URLs that need to be rewritten, so that complex proxying scenarios can be handled.

    -- 2.40.0