Apache监听多个端口配置

Listen 80
Listen 8081
Listen 8082

2.打开vhosts.conf配置文件,新增虚拟目录,如下:

<VirtualHost *:8081>
    DocumentRoot "D:www目录"
    ServerName www.test.cn   --域名,随手设置的,可以直接访问IP+端口号
    ServerAlias 
  <Directory "D:www目录">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
     Require all granted
  </Directory>
</VirtualHost>

3.重启apache服务,OK