【备份】信工apache中有关http.conf的虚拟目录相关配置参考

参考信工服务器的
在http.conf文件的后面设置是这样(#为注释)
#打开虚拟端口
NameVirtualHost *:80
#设置虚拟端口80的目录
#ServerName 是访问的域名或IP
#DocumentRoot 是对应的IP
<Virtualhost *:80>
 ServerName 210.38.206.90
 DocumentRoot c:/wamp/www/
</Virtualhost>
#上述这个就是使用210.38.206.90(或者域名)访问,就读取c:/wamp/www/的网站
<Virtualhost *:80>
 ServerName 210.38.206.21
 DocumentRoot C:\www\shelianwang\upload
</Virtualhost>
<Virtualhost *:80>
 ServerName 210.38.206.92
 DocumentRoot c:/wamp/www/wordpress/
</Virtualhost>
这样,服务器在同一台机上,
但访问210.38.206.21
210.38.206.90
210.38.206.92
都会读取不同的目录和网站
当然,如果你只有一个ip
可以设置
NameVirtualHost *:8080
<Virtualhost *:8080>
 ServerName 210.38.206.90
 DocumentRoot c:/wamp/www/
</Virtualhost>
来指定自定义的目录

原文地址:https://www.cnblogs.com/sbaicl/p/2697747.html