several frequently used directives for apache server

1.<vituralhost><vituralhost/>, this directive encloses/contains a group of directives and only apply to a paticular vitural host.
Syntax: <VirtualHost addr[:port] [addr[:port]] ...> ... </VirtualHost>
Available values for addr can be:
(1)IP address for virtual host
(2)full quailfied domain name for IP address(deprecated)
(3)*,used only in combination with NameVirtualHost * to match all IP address
(4)_default_,catch unmatched address
Annotation: what is virtual host? Virtual host is a term, 
it is used to describe the practice of
running more than one web site on a single machine.
Virtual can be based on ip which means each web site has its own address,
or domain name which means there have multiple names for each ip.
A typical example for name-based virtual host in HTTP server can be configured like this:
current IP has already been used to match www.yourdomain.itb,
but still can be used to match another virture machine:www.otherdomain.itb.
NameVirtualHost *:80  ----NameVirtualHost用来指定那个IP地址来接受请求,这里使用*匹配服务器上所有的地址
<VirtualHost *:80>
ServerName www.yourdomain.itb
ServerAlias yourdomain.itb *.yourdomain.itb
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.itb
DocumentRoot /www/otherdomain
</VirtualHost>
注意:如果向一个已经存在的web server添加虚拟机,需要一个为已经存在的创建<virtualhost>脚本,
这个虚拟机中所包含的ServerName和DocumentRoot要和全局的ServerName和DocumentRoot保持一致。
同时,把它放在配置文件中虚拟机列表的最前面,这样它就是缺省的虚拟机.
--待续

你可能感兴趣的:(apache,虚拟机,server,domain,each,deprecated)