From: Astrid Malo Date: Sat, 31 May 2003 01:31:08 +0000 (+0000) Subject: some markup improvement X-Git-Tag: pre_ajp_proxy~1594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bf748cf11cac878d144b19ed02378c39bbf881b;p=apache some markup improvement git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100118 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/vhosts/name-based.html.en b/docs/manual/vhosts/name-based.html.en index 1c6cb415d9..c6bae83a35 100644 --- a/docs/manual/vhosts/name-based.html.en +++ b/docs/manual/vhosts/name-based.html.en @@ -79,31 +79,30 @@ requests for the hosts. This is configured using the NameVirtualHost directive. In the normal case where any and all IP addresses on the server should be used, you can use * as the argument to - NameVirtualHost. Note that mentioning an IP address in a - NameVirtualHost directive does not automatically make the - server listen to that IP address. See Setting - which addresses and ports Apache uses for more details. In addition, - any IP address specified here must be associated with a network interface + NameVirtualHost. Note that mentioning an + IP address in a NameVirtualHost directive + does not automatically make the server listen to that IP address. See + Setting which addresses and ports Apache uses + for more details. In addition, any IP address specified here must be + associated with a network interface on the server.

The next step is to create a <VirtualHost> block for each different host that you would like to serve. The argument to the - <VirtualHost> directive should be the same as the - argument to the NameVirtualHost directive (ie, an IP - address, or * for all addresses). Inside each - <VirtualHost> block, you will need at minimum a + <VirtualHost> directive + should be the same as the argument to the NameVirtualHost directive (ie, an IP address, + or * for all addresses). Inside each <VirtualHost> block, you will need at minimum a ServerName directive to designate which host is served and a DocumentRoot directive to show where in the filesystem the content for that host lives.

Main host goes away

If you are adding virtual hosts to an existing web server, you - must also create a <VirtualHost> block for the existing host. - The ServerName and DocumentRoot included in - this virtual host should be the same as the global - ServerName and DocumentRoot. List this - virtual host first in the configuration file so that it will act as - the default host. + must also create a <VirtualHost> block for the existing host. + The ServerName and + DocumentRoot included in this virtual + host should be the same as the global ServerName and DocumentRoot. List this virtual host first in + the configuration file so that it will act as the default host.

For example, suppose that you are serving the domain @@ -130,18 +129,17 @@

You can alternatively specify an explicit IP address in place of - the * in both the NameVirtualHost and - <VirtualHost> directives. For example, you might - want to do this in order to run some name-based virtual hosts on one - IP address, and either IP-based, or another set of name-based - virtual hosts on another address.

+ the * in both the NameVirtualHost and <VirtualHost> directives. + For example, you might want to do this in order to run some name-based virtual + hosts on one IP address, and either IP-based, or another set of name-based + virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias - directive, placed inside the <VirtualHost> section. For - example in the first <VirtualHost> block above, the ServerAlias directive indicates that the - listed names are other names which people can use to see that same - web site:

+ directive, placed inside the <VirtualHost> section. For + example in the first <VirtualHost> block above, the ServerAlias directive indicates that the + listed names are other names which people can use to see that same + web site:

ServerAlias domain.tld *.domain.tld @@ -149,41 +147,39 @@

then requests for all hosts in the domain.tld domain will be served by the www.domain.tld virtual host. The - wildcard characters * and ? can be used to match names. Of course, - you can't just make up names and place them in ServerName - or ServerAlias. You must first have your DNS server - properly configured to map those names to an IP address associated - with your server.

+ wildcard characters * and ? can be used to match + names. Of course, you can't just make up names and place them in ServerName or ServerAlias. + You must first have your DNS server properly configured to map those names + to an IP address associated with your server.

Finally, you can fine-tune the configuration of the virtual hosts by placing other directives inside the - <VirtualHost> containers. Most directives can be - placed in these containers and will then change the configuration only - of the relevant virtual host. To find out if a particular directive - is allowed, check the Context of the + <VirtualHost> containers. + Most directives can be placed in these containers and will then change the + configuration only of the relevant virtual host. To find out if a particular + directive is allowed, check the Context of the directive. Configuration directives set in the main server - context (outside any <VirtualHost> container) - will be used only if they are not overridden by the virtual host - settings.

+ context (outside any <VirtualHost> container) will be used only if they + are not overridden by the virtual host settings.

Now when a request arrives, the server will first check if it is - using an IP address that matches the NameVirtualHost. If - it is, then it will look at each <VirtualHost> - section with a matching IP address and try to find one where the - ServerName or ServerAlias matches the - requested hostname. If it finds one, then it uses the configuration - for that server. If no matching virtual host is found, then - the first listed virtual host that matches the IP - address will be used.

+ using an IP address that matches the NameVirtualHost. If it is, then it will look at + each <VirtualHost> + section with a matching IP address and try to find one where the + ServerName or + ServerAlias matches the requested hostname. If it finds one, + then it uses the configuration for that server. If no matching virtual host + is found, then the first listed virtual host that matches + the IP address will be used.

As a consequence, the first listed virtual host is the - default virtual host. The DocumentRoot from the + default virtual host. The DocumentRoot from the main server will never be used when an IP - address matches the NameVirtualHost directive. If you - would like to have a special configuration for requests that do not - match any particular virtual host, simply put that configuration in a - <VirtualHost> container and list it first in the - configuration file.

+ address matches the NameVirtualHost + directive. If you would like to have a special configuration for requests + that do not match any particular virtual host, simply put that configuration + in a <VirtualHost> + container and list it first in the configuration file.

top
@@ -221,18 +217,17 @@

What does this mean? It means that a request for any URI beginning with "/domain" will be served from the - virtual host www.domain.tld This means that the - pages can be accessed as - http://www.domain.tld/domain/ for all clients, - although clients sending a Host: header can also - access it as http://www.domain.tld/.

+ virtual host www.domain.tld. This means that the + pages can be accessed as http://www.domain.tld/domain/ + for all clients, although clients sending a Host: header + can also access it as http://www.domain.tld/.

In order to make this work, put a link on your primary virtual host's page to - http://www.domain.tld/domain/ Then, in the virtual + http://www.domain.tld/domain/. Then, in the virtual host's pages, be sure to use either purely relative links (e.g., "file.html" or - "../icons/image.gif" or links containing the + "../icons/image.gif") or links containing the prefacing /domain/ (e.g., "http://www.domain.tld/domain/misc/file.html" or "/domain/misc/file.html").

diff --git a/docs/manual/vhosts/name-based.xml b/docs/manual/vhosts/name-based.xml index 0041ffc8d4..c5c804fa1d 100644 --- a/docs/manual/vhosts/name-based.xml +++ b/docs/manual/vhosts/name-based.xml @@ -78,20 +78,22 @@ module="core">NameVirtualHost directive. In the normal case where any and all IP addresses on the server should be used, you can use * as the argument to - NameVirtualHost. Note that mentioning an IP address in a - NameVirtualHost directive does not automatically make the - server listen to that IP address. See Setting - which addresses and ports Apache uses for more details. In addition, - any IP address specified here must be associated with a network interface + NameVirtualHost. Note that mentioning an + IP address in a NameVirtualHost directive + does not automatically make the server listen to that IP address. See + Setting which addresses and ports Apache uses + for more details. In addition, any IP address specified here must be + associated with a network interface on the server.

The next step is to create a VirtualHost block for each different host that you would like to serve. The argument to the - <VirtualHost> directive should be the same as the - argument to the NameVirtualHost directive (ie, an IP - address, or * for all addresses). Inside each - <VirtualHost> block, you will need at minimum a + VirtualHost directive + should be the same as the argument to the NameVirtualHost directive (ie, an IP address, + or * for all addresses). Inside each VirtualHost block, you will need at minimum a ServerName directive to designate which host is served and a DocumentRoot directive to @@ -99,12 +101,14 @@ Main host goes away If you are adding virtual hosts to an existing web server, you - must also create a <VirtualHost> block for the existing host. - The ServerName and DocumentRoot included in - this virtual host should be the same as the global - ServerName and DocumentRoot. List this - virtual host first in the configuration file so that it will act as - the default host. + must also create a VirtualHost block for the existing host. + The ServerName and + DocumentRoot included in this virtual + host should be the same as the global ServerName and DocumentRoot. List this virtual host first in + the configuration file so that it will act as the default host.

For example, suppose that you are serving the domain @@ -131,19 +135,22 @@

You can alternatively specify an explicit IP address in place of - the * in both the NameVirtualHost and - <VirtualHost> directives. For example, you might - want to do this in order to run some name-based virtual hosts on one - IP address, and either IP-based, or another set of name-based - virtual hosts on another address.

+ the * in both the NameVirtualHost and VirtualHost directives. + For example, you might want to do this in order to run some name-based virtual + hosts on one IP address, and either IP-based, or another set of name-based + virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias - directive, placed inside the <VirtualHost> section. For - example in the first <VirtualHost> block above, the ServerAlias directive indicates that the - listed names are other names which people can use to see that same - web site:

+ directive, placed inside the VirtualHost section. For + example in the first VirtualHost block above, the ServerAlias directive indicates that the + listed names are other names which people can use to see that same + web site:

ServerAlias domain.tld *.domain.tld @@ -151,42 +158,44 @@

then requests for all hosts in the domain.tld domain will be served by the www.domain.tld virtual host. The - wildcard characters * and ? can be used to match names. Of course, - you can't just make up names and place them in ServerName - or ServerAlias. You must first have your DNS server - properly configured to map those names to an IP address associated - with your server.

+ wildcard characters * and ? can be used to match + names. Of course, you can't just make up names and place them in ServerName or ServerAlias. + You must first have your DNS server properly configured to map those names + to an IP address associated with your server.

Finally, you can fine-tune the configuration of the virtual hosts by placing other directives inside the - <VirtualHost> containers. Most directives can be - placed in these containers and will then change the configuration only - of the relevant virtual host. To find out if a particular directive - is allowed, check the VirtualHost containers. + Most directives can be placed in these containers and will then change the + configuration only of the relevant virtual host. To find out if a particular + directive is allowed, check the Context of the directive. Configuration directives set in the main server - context (outside any <VirtualHost> container) - will be used only if they are not overridden by the virtual host - settings.

+ context (outside any VirtualHost container) will be used only if they + are not overridden by the virtual host settings.

Now when a request arrives, the server will first check if it is - using an IP address that matches the NameVirtualHost. If - it is, then it will look at each <VirtualHost> - section with a matching IP address and try to find one where the - ServerName or ServerAlias matches the - requested hostname. If it finds one, then it uses the configuration - for that server. If no matching virtual host is found, then - the first listed virtual host that matches the IP - address will be used.

+ using an IP address that matches the NameVirtualHost. If it is, then it will look at + each VirtualHost + section with a matching IP address and try to find one where the + ServerName or + ServerAlias matches the requested hostname. If it finds one, + then it uses the configuration for that server. If no matching virtual host + is found, then the first listed virtual host that matches + the IP address will be used.

As a consequence, the first listed virtual host is the - default virtual host. The DocumentRoot from the + default virtual host. The DocumentRoot from the main server will never be used when an IP - address matches the NameVirtualHost directive. If you - would like to have a special configuration for requests that do not - match any particular virtual host, simply put that configuration in a - <VirtualHost> container and list it first in the - configuration file.

+ address matches the NameVirtualHost + directive. If you would like to have a special configuration for requests + that do not match any particular virtual host, simply put that configuration + in a VirtualHost + container and list it first in the configuration file.

@@ -225,18 +234,17 @@

What does this mean? It means that a request for any URI beginning with "/domain" will be served from the - virtual host www.domain.tld This means that the - pages can be accessed as - http://www.domain.tld/domain/ for all clients, - although clients sending a Host: header can also - access it as http://www.domain.tld/.

+ virtual host www.domain.tld. This means that the + pages can be accessed as http://www.domain.tld/domain/ + for all clients, although clients sending a Host: header + can also access it as http://www.domain.tld/.

In order to make this work, put a link on your primary virtual host's page to - http://www.domain.tld/domain/ Then, in the virtual + http://www.domain.tld/domain/. Then, in the virtual host's pages, be sure to use either purely relative links (e.g., "file.html" or - "../icons/image.gif" or links containing the + "../icons/image.gif") or links containing the prefacing /domain/ (e.g., "http://www.domain.tld/domain/misc/file.html" or "/domain/misc/file.html").