<dd>
<example><title>Example:</title>
- Allow from apache.org<br />
+ Allow from example.org<br />
Allow from .net example.edu
</example>
<p>Hosts whose names match, or end in, this string are allowed
access. Only complete components are matched, so the above
- example will match <code>foo.apache.org</code> but it will not
- match <code>fooapache.org</code>. This configuration will cause
+ example will match <code>foo.example.org</code> but it will not
+ match <code>fooexample.org</code>. This configuration will cause
Apache httpd to perform a double DNS lookup on the client IP
address, regardless of the setting of the <directive
module="core">HostnameLookups</directive> directive. It will do
</tr>
</table>
- <p>In the following example, all hosts in the apache.org domain
+ <p>In the following example, all hosts in the example.org domain
are allowed access; all other hosts are denied access.</p>
<example>
Order Deny,Allow<br />
Deny from all<br />
- Allow from apache.org
+ Allow from example.org
</example>
- <p>In the next example, all hosts in the apache.org domain are
+ <p>In the next example, all hosts in the example.org domain are
allowed access, except for the hosts which are in the
- foo.apache.org subdomain, who are denied access. All hosts not
- in the apache.org domain are denied access because the default
+ foo.example.org subdomain, who are denied access. All hosts not
+ in the example.org domain are denied access because the default
state is to <directive module="mod_access_compat">Deny</directive>
access to the server.</p>
<example>
Order Allow,Deny<br />
- Allow from apache.org<br />
- Deny from foo.apache.org
+ Allow from example.org<br />
+ Deny from foo.example.org
</example>
<p>On the other hand, if the <directive>Order</directive> in the
last example is changed to <code>Deny,Allow</code>, all hosts will
be allowed access. This happens because, regardless of the actual
ordering of the directives in the configuration file, the
- <code>Allow from apache.org</code> will be evaluated last and will
- override the <code>Deny from foo.apache.org</code>. All hosts not in
- the <code>apache.org</code> domain will also be allowed access
+ <code>Allow from example.org</code> will be evaluated last and will
+ override the <code>Deny from foo.example.org</code>. All hosts not in
+ the <code>example.org</code> domain will also be allowed access
because the default state is <directive
module="mod_access_compat">Allow</directive>.</p>
<p>A (partial) domain-name</p>
<example>
- Require host apache.org<br />
+ Require host example.org<br />
Require host .net example.edu
</example>
<p>Hosts whose names match, or end in, this string are allowed
access. Only complete components are matched, so the above
- example will match <code>foo.apache.org</code> but it will not
- match <code>fooapache.org</code>. This configuration will cause
+ example will match <code>foo.example.org</code> but it will not
+ match <code>fooexample.org</code>. This configuration will cause
Apache to perform a double reverse DNS lookup on the client IP
address, regardless of the setting of the <directive
module="core">HostnameLookups</directive> directive. It will do
CacheEnable disk /<br /><br />
# Cache FTP-proxied url's<br />
CacheEnable disk ftp://<br /><br />
- # Cache content from www.apache.org<br />
- CacheEnable disk http://www.apache.org/<br />
+ # Cache content from www.example.org<br />
+ CacheEnable disk http://www.example.org/<br />
</example>
<p>A hostname starting with a <strong>"*"</strong> matches all hostnames with
hostnames containing the domain components that follow.</p>
<example>
- # Match www.apache.org, and fooapache.org<br />
- CacheEnable disk http://*apache.org/<br />
- # Match www.apache.org, but not fooapache.org<br />
- CacheEnable disk http://.apache.org/<br />
+ # Match www.example.org, and fooexample.org<br />
+ CacheEnable disk http://*example.org/<br />
+ # Match www.example.org, but not fooexample.org<br />
+ CacheEnable disk http://.example.org/<br />
</example>
<p> The <code>no-cache</code> environment variable can be set to
all ending in <var>Domain</var>).</p>
<example><title>Examples</title>
- .com .apache.org.
+ .com .example.org.
</example>
<p>To distinguish <var>Domain</var>s from <var><a href="#hostname"
of hosts with different <var><a href="#ipaddr">IPAddr</a></var>s).</p>
<example><title>Examples</title>
- prep.ai.example.com<br />
- www.apache.org
+ prep.ai.example.edu<br />
+ www.example.org
</example>
<note><title>Note</title>
and differs only in that the regular expression matching is
performed in a case-insensitive manner. For example:</p>
<example>
- SetEnvIfNoCase Host Apache\.Org site=apache
+ SetEnvIfNoCase Host Example\.Org site=example
</example>
<p>This will cause the <code>site</code> environment variable
- to be set to "<code>apache</code>" if the HTTP request header
+ to be set to "<code>example</code>" if the HTTP request header
field <code>Host:</code> was included and contained
- <code>Apache.Org</code>, <code>apache.org</code>, or any other
+ <code>Example.Org</code>, <code>example.org</code>, or any other
combination.</p>
</usage>
</directivesynopsis>
<ol>
<li><p><strong>Network Domain.</strong> Enter the DNS domain in which
your server is or will be registered in. For example, if your
- server's full DNS name is <code>server.mydomain.net</code>, you would
- type <code>mydomain.net</code> here.</p></li>
+ server's full DNS name is <code>server.example.net</code>, you would
+ type <code>example.net</code> here.</p></li>
<li><p><strong>Server Name.</strong> Your server's full DNS name.
- From the example above, you would type <code>server.mydomain.net</code>
+ From the example above, you would type <code>server.example.net</code>
here.</p></li>
<li><p><strong>Administrator's Email Address.</strong> Enter the
<example>
RewriteEngine On<br />
-RewriteRule ^/index\.html - [CO=frontdoor:yes:.apache.org:1440:/]
+RewriteRule ^/index\.html - [CO=frontdoor:yes:.example.com:1440:/]
</example>
<p>In the example give, the rule doesn't rewrite the request.
The "-" rewrite target tells mod_rewrite to pass the request
through unchanged. Instead, it sets a cookie
called 'frontdoor' to a value of 'yes'. The cookie is valid for any host
-in the <code>.apache.org</code> domain. It will be set to expire in 1440
+in the <code>.example.com</code> domain. It will be set to expire in 1440
minutes (24 hours) and will be returned for all URIs.</p>
</section>
Require all granted
</example>
- <p>In the following example, all hosts in the apache.org domain
+ <p>In the following example, all hosts in the example.org domain
are allowed access; all other hosts are denied access.</p>
<example>
<title>2.2 configuration:</title>
Order Deny,Allow<br />
Deny from all<br />
- Allow from apache.org
+ Allow from example.org
</example>
<example>
<title>2.4 configuration:</title>
- Require host apache.org
+ Require host example.org
</example>
</section>
<VirtualHost 172.20.30.40><br />
<indent>
DocumentRoot /www/example3<br />
- ServerName www.example3.net<br />
+ ServerName www.example.net<br />
</indent>
</VirtualHost><br />
<br />
<VirtualHost 172.20.30.50><br />
<indent>
DocumentRoot /www/example4<br />
- ServerName www.example4.edu<br />
+ ServerName www.example.edu<br />
</indent>
</VirtualHost><br />
<br />
<VirtualHost 172.20.30.60><br />
<indent>
DocumentRoot /www/example5<br />
- ServerName www.example5.gov<br />
+ ServerName www.example.gov<br />
</indent>
</VirtualHost>
</example>
<example>
<VirtualHost 172.20.30.40:80><br />
- ServerAdmin webmaster@example1.com<br />
- DocumentRoot /www/vhosts/example1<br />
- ServerName www.example1.com<br />
- ErrorLog /www/logs/example1/error_log<br />
- CustomLog /www/logs/example1/access_log combined<br />
+ ServerAdmin webmaster@www1.example.com<br />
+ DocumentRoot /www/vhosts/www1<br />
+ ServerName www1.example.com<br />
+ ErrorLog /www/logs/www1/error_log<br />
+ CustomLog /www/logs/www1/access_log combined<br />
</VirtualHost><br />
<br />
<VirtualHost 172.20.30.50:80><br />
- ServerAdmin webmaster@example2.org<br />
- DocumentRoot /www/vhosts/example2<br />
- ServerName www.example2.org<br />
- ErrorLog /www/logs/example2/error_log<br />
- CustomLog /www/logs/example2/access_log combined<br />
+ ServerAdmin webmaster@www2.example.org<br />
+ DocumentRoot /www/vhosts/www2<br />
+ ServerName www2.example.org<br />
+ ErrorLog /www/logs/www2/error_log<br />
+ CustomLog /www/logs/www2/access_log combined<br />
</VirtualHost>
</example>
<pre>
NameVirtualHost 111.22.33.44
<VirtualHost 111.22.33.44>
- ServerName www.customer-1.com
- DocumentRoot /www/hosts/www.customer-1.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-1.com/cgi-bin
+ ServerName customer-1.example.com
+ DocumentRoot /www/hosts/customer-1.example.com/docs
+ ScriptAlias /cgi-bin/ /www/hosts/customer-1.example.com/cgi-bin
</VirtualHost>
<VirtualHost 111.22.33.44>
- ServerName www.customer-2.com
- DocumentRoot /www/hosts/www.customer-2.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-2.com/cgi-bin
+ ServerName customer-2.example.com
+ DocumentRoot /www/hosts/customer-2.example.com/docs
+ ScriptAlias /cgi-bin/ /www/hosts/customer-2.example.com/cgi-bin
</VirtualHost>
<VirtualHost 111.22.33.44>
- ServerName www.customer-N.com
- DocumentRoot /www/hosts/www.customer-N.com/docs
- ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin
+ ServerName customer-N.example.com
+ DocumentRoot /www/hosts/customer-N.example.com/docs
+ ScriptAlias /cgi-bin/ /www/hosts/customer-N.example.com/cgi-bin
</VirtualHost>
</pre>
</example>
ISP's web hosting server. Using <code>%2</code>,
we can select substrings of the server name to
use in the filename so that, for example, the documents for
- <code>www.user.isp.com</code> are found in
+ <code>www.user.example.com</code> are found in
<code>/home/user/www</code>. It uses a single <code>cgi-bin</code>
directory instead of one per virtual host.</p>
<br />
<VirtualHost 111.22.33.44><br />
<indent>
- ServerName www.commercial.isp.com<br />
+ ServerName www.commercial.example.com<br />
<br />
CustomLog logs/access_log.commercial vcommon<br />
<br />
<br />
<VirtualHost 111.22.33.45><br />
<indent>
- ServerName www.homepages.isp.com<br />
+ ServerName www.homepages.example.com<br />
<br />
CustomLog logs/access_log.homepages vcommon<br />
<br />