[deployment-guide/comm-rel: 632/727] Updated the Setting Up Virtual Hosts section.
Jaromir Hradilek
jhradile at fedoraproject.org
Tue Oct 19 13:18:45 UTC 2010
commit 0d343c657e07df7d9f6a6c3687011a7ba56cfbcc
Author: Jaromir Hradilek <jhradile at redhat.com>
Date: Wed Sep 8 17:05:49 2010 +0200
Updated the Setting Up Virtual Hosts section.
en-US/The_Apache_HTTP_Server.xml | 75 ++++++++++++++------------------------
1 files changed, 27 insertions(+), 48 deletions(-)
---
diff --git a/en-US/The_Apache_HTTP_Server.xml b/en-US/The_Apache_HTTP_Server.xml
index 5d39eed..31b9f2c 100644
--- a/en-US/The_Apache_HTTP_Server.xml
+++ b/en-US/The_Apache_HTTP_Server.xml
@@ -2903,58 +2903,37 @@ ErrorDocument 404 /404-not_found.html</screen>
</para>
</section>
<section id="s1-apache-virtualhosts">
- <title>Virtual Hosts</title>
+ <title>Setting Up Virtual Hosts</title>
<para>
- 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. A complete guide to using virtual hosts is available online at <ulink url="http://httpd.apache.org/docs/2.2/vhosts/" />.
+ 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>
- <section id="s2-apache-settingupvhosts">
- <title>Setting Up Virtual Hosts</title>
- <para>
- To create a name-based virtual host, it is best to use the virtual host container provided in <filename>httpd.conf</filename> as an example.
- </para>
- <para>
- The virtual host example read as follows:
- </para>
- <screen>#<VirtualHost *:80>
-# ServerAdmin webmaster at dummy-host.example.com
-# DocumentRoot /www/docs/dummy-host.example.com
-# ServerName dummy-host.example.com
-# ErrorLog logs/dummy-host.example.com-error_log
-# CustomLog logs/dummy-host.example.com-access_log common
-#</VirtualHost></screen>
- <screen>#NameVirtualHost *:80
-#
-#<VirtualHost *:80>
-# ServerAdmin webmaster at dummy-host.example.com
-# DocumentRoot /www/docs/dummy-host.example.com
-# ServerName dummy-host.example.com
-# ErrorLog logs/dummy-host.example.com-error_log
-# CustomLog logs/dummy-host.example.com-access_log common #</VirtualHost></screen>
- <para>
- To activate name-based virtual hosting, uncomment the <command>NameVirtualHost</command> line by removing the hash mark (<command>#</command>) and replace the asterisk (<command>*</command>) with the IP address assigned to the machine.
- </para>
- <para>
- Next, configure a virtual host by uncommenting and customizing the <command><VirtualHost></command> container.
- </para>
- <para>
- On the <command><VirtualHost></command> line, change the asterisk (<command>*</command>) to the server's IP address. Change the <command>ServerName</command> to a <emphasis>valid</emphasis> DNS name assigned to the machine, and configure the other directives as necessary.
- </para>
- <para>
- The <command><VirtualHost></command> container is highly customizable and accepts almost every directive available within the main server configuration.
- </para>
- <note>
- <title>Tip</title>
- <para>
- If configuring a virtual host to listen on a non-default port, that port must be added to the <command>Listen</command> directive in the global settings section of <filename>/etc/httpd/conf/httpd.conf</filename> file.
- </para>
- </note>
- <para>
- To activate a newly created virtual host, the Apache HTTP Server must be reloaded or restarted. Refer to <xref linkend="s1-apache-running" /> for further instructions.
- </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" />.
+ </para>
+ <example id="example-apache-virtualhosts-config">
+ <title>Sampe virtual host configuration</title>
+ <screen>NameVirtualHost penguin.example.com:80
+
+<VirtualHost penguin.example.com:80>
+ ServerAdmin webmaster at 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></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.
+ </para>
+ <note>
+ <title>Note: Changing the Port Number</title>
<para>
- Comprehensive information about creating and configuring both name-based and IP address-based virtual hosts is provided online at <ulink url="http://httpd.apache.org/docs/2.2/vhosts/">http://httpd.apache.org/docs/2.2/vhosts/</ulink>.
+ If you configure a virtual host to listen on a non-default port, make sure you update the <option>Listen</option> directive in the global settings section of the <filename>/etc/httpd/conf/httpd.conf</filename> file accordingly.
</para>
- </section>
+ </note>
+ <para>
+ To activate a newly created virtual host, the web server has to be restarted first. Refer to <xref linkend="s3-apache-running-restarting" /> for more information on how to restart the <systemitem class="service">httpd</systemitem> service.
+ </para>
</section>
<section id="s1-httpd-secure-server">
<title>Apache HTTP Secure Server Configuration</title>
More information about the docs-commits
mailing list