@@ -167,6 +167,33 @@ recommend you ensure your Web server is configured such that:
167167Additionally, as of 1.3.1, Django requires you to explicitly enable support for
168168the ``X-Forwarded-Host`` header if your configuration requires it.
169169
170+ Configuration for Apache
171+ ------------------------
172+
173+ The easiest way to get the described behavior in Apache is as follows. Create
174+ a `virtual host`_ using the ServerName_ and ServerAlias_ directives to restrict
175+ the domains Apache reacts to. Please keep in mind that while the directives do
176+ support ports the match is only performed against the hostname. This means that
177+ the ``Host`` header could still contain a port pointing to another webserver on
178+ the same machine. The next step is to make sure that your newly created virtual
179+ host is not also the default virtual host. Apache uses the first virtual host
180+ found in the configuration file as default virtual host. As such you have to
181+ ensure that you have another virtual host which will act as catch-all virtual
182+ host. Just add one if you do not have one already, there is nothing special
183+ about it aside from ensuring it is the first virtual host in the configuration
184+ file. Debian/Ubuntu users usually don't have to take any action, since Apache
185+ ships with a default virtual host in ``sites-available`` which is linked into
186+ ``sites-enabled`` as ``000-default`` and included from ``apache2.conf``. Just
187+ make sure not to name your site ``000-abc``, since files are included in
188+ alphabetical order.
189+
190+ .. _virtual host: http://httpd.apache.org/docs/2.2/vhosts/
191+ .. _ServerName: http://httpd.apache.org/docs/2.2/mod/core.html#servername
192+ .. _ServerAlias: http://httpd.apache.org/docs/2.2/mod/core.html#serveralias
193+
194+
195+
196+
170197Additional security topics
171198==========================
172199
0 commit comments