apache 监听不同的端口并设置虚拟路径的实例

#Listen 12.34.56.78:80
Listen 8080
Listen 8891
Listen 8892

NameVirtualHost *:8891
<VirtualHost *:8891>
ServerAdmin admin@localhost
DocumentRoot "d:/KM/ktvme"        这个文件的真实路径
ServerName 192.168.73.10:8891
<Directory "d:/KM/ktvme/">
    Options Indexes FollowSymLinks
    AllowOverride all
#   onlineoffline tag - don't remove
    Order Allow,Deny
    Allow from all
    Allow from 127.0.0.1
    Allow from 192.168.73.10
</Directory>
</VirtualHost>

NameVirtualHost *:8892
<VirtualHost *:8892>
ServerAdmin admin@localhost
DocumentRoot "D:\wamp\www\KMBackgroud"
ServerName 192.168.73.10:8892
<Directory "D:\wamp\www\KMBackgroud">
    Options Indexes FollowSymLinks
    AllowOverride all
#   onlineoffline tag - don't remove
    Order Allow,Deny
    Allow from all
    Allow from 127.0.0.1
    Allow from 192.168.73.10
</Directory>
</VirtualHost>

你可能感兴趣的:(apache 监听不同的端口并设置虚拟路径的实例)