First of all we have a domain name xxx.com; (Note that two first-level domain names may be different)
There are two levels of two domain names priject.xxx.com and movie.xxx.com
There is a host that now assumes access to the host computer
IIS Server Virtual Host configuration method
1. Add a Web site to IIS
Where the host name in the binding column is priject.xxx.com, the file path of the site is assigned well
2. Add an ISAPI filter
Where the executable file location is the installation location of PHP
3. Add script mappings, handler mappings
4, finally restart the IIS server, you can use the domain name to access the
Add the site again, the same steps.
Tomcat Server Virtual Host configuration method
Add host node under engine node
Unpackwars= "true" autodeploy= "true" >
<!--Singlesignon valve, share authentication between Web applications
Documentation at:/docs/config/valve.html--
<!--
<valve classname= "Org.apache.catalina.authenticator.SingleSignOn"/>
-
<!--Access log processes all example.
Documentation at:/docs/config/valve.html
Note:the pattern used is equivalent to using pattern= "common"-
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"
prefix= "Localhost_access_log" suffix= ". txt"
pattern= "%h%l%u%t "%r" %s%b "/>
</Host>
Unpackwars= "true" autodeploy= "true" >
<!--Singlesignon valve, share authentication between Web applications
Documentation at:/docs/config/valve.html--
<!--
<valve classname= "Org.apache.catalina.authenticator.SingleSignOn"/>
-
<!--Access log processes all example.
Documentation at:/docs/config/valve.html
Note:the pattern used is equivalent to using pattern= "common"-
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"
prefix= "Localhost_access_log" suffix= ". txt"
pattern= "%h%l%u%t "%r" %s%b "/>
</Host>
Note In the WebApps directory, movie to create the root directory, and root must be capitalized. Place the JSP code first in the root directory.
Tomcat automatically finds the appropriate directory to access according to the host name
Apache Server Virtual Host configuration method
Open httpd.conf File
Remove LoadModule vhost_alias_module modules/mod_vhost_alias.so
The # in front of this sentence
And
Include conf/extra/httpd-vhosts.conf the line in front of the # number
Include conf/extra/httpd-vhosts.conf This sentence at the bottom of the httpd.conf file
Then open the httpd-vhosts.conf file under Apache2.2\conf\extra, and add the following code
#配置自己的虚拟主机
<virtualhost *:80>
#网站目录, if the PHP directory under the WWW directory, the following #就填写F:/www/php
DocumentRoot "d:/www/Site Directory"
#域名
ServerName priject.xxx.com
#这里配置欢迎首页面
DirectoryIndex index.html index.htm index.php
<directory/>
Options FollowSymLinks
#不允许别人修改我们的页面
AllowOverride None
#设置访问权限
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
<virtualhost *:80>
#网站目录, if the PHP directory under the WWW directory, the following #就填写F:/www/php
DocumentRoot "d:/www/Site Directory"
#域名
ServerName movie.xxx.com
#这里配置欢迎首页面
DirectoryIndex index.html index.htm index.php
<directory/>
Options FollowSymLinks
#不允许别人修改我们的页面
AllowOverride None
#设置访问权限
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
IIS, Apache, Tomcat server virtual host Configuration