commit 923da75a34a3578837120a715326adf0614b5fd1
Author: Stephen Wadeley <swadeley(a)redhat.com>
Date: Wed Aug 13 23:09:07 2014 +0200
Example virtual host configuration
en-US/The_Apache_HTTP_Server.xml | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/en-US/The_Apache_HTTP_Server.xml b/en-US/The_Apache_HTTP_Server.xml
index d04554d..dc40ac8 100644
--- a/en-US/The_Apache_HTTP_Server.xml
+++ b/en-US/The_Apache_HTTP_Server.xml
@@ -3794,19 +3794,19 @@ ErrorDocument 404 /404-not_found.html</programlisting>
The Apache HTTP Server's built in virtual hosting allows the server to provide
different information based on which IP address, hostname, or port is being requested.
</para>
<para>
- To create a name-based virtual host, find the virtual host container provided in
<filename>/etc/httpd/conf/httpd.conf</filename> as an example, remove the hash
sign (that is, <literal>#</literal>) from the beginning of each line, and
customize the options according to your requirements as shown in <xref
linkend="example-apache-virtualhosts-config" />.
+ To create a name-based virtual host, copy the example configuration file
<filename>/usr/share/doc/httpd-<replaceable>VERSION</replaceable>/httpd-vhosts.conf</filename>
into the <filename class="directory">/etc/httpd/conf.d/</filename>
directory, and replace the <literal>@@Port@@</literal> and
<literal>@@ServerRoot@@</literal> placeholder values. Customize the options
according to your requirements as shown in <xref
linkend="example-apache-virtualhosts-config"/>.
</para>
<example id="example-apache-virtualhosts-config">
- <title>Sample virtual host configuration</title>
- <programlisting>NameVirtualHost penguin.example.com:80
-
-<VirtualHost penguin.example.com:80>
+ <title>Example virtual host configuration</title>
+ <screen>
+<VirtualHost *:80>
ServerAdmin webmaster(a)penguin.example.com
- DocumentRoot /www/docs/penguin.example.com
- ServerName penguin.example.com:80
- ErrorLog logs/penguin.example.com-error_log
- CustomLog logs/penguin.example.com-access_log common
-</VirtualHost></programlisting>
+ DocumentRoot "/www/docs/penguin.example.com"
+ ServerName
penguin.example.com
+ ServerAlias
www.penguin.example.com
+ ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
+ CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common
+</VirtualHost></screen>
</example>
<para>
Note that <option>ServerName</option> must be a valid DNS name assigned
to the machine. The <option><VirtualHost></option> container is
highly customizable, and accepts most of the directives available within the main server
configuration. Directives that are <emphasis>not</emphasis> supported within
this container include <option>User</option> and
<option>Group</option>, which were replaced by
<option>SuexecUserGroup</option>.