设置Apache监听多个端口

1、在配置文件httpd.conf中Listen多个端口

    Listen localhost:8033
    Listen localhost:8083

    .......

2、在配置文件夹下的extra文件夹下httpd-vhosts.conf文件中加入如下内容:

<VirtualHost *:8033>
   DocumentRoot "F:wampwww"
   ServerName localhost 
    <Directory "F:wampwww" >
    Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:8083>
   DocumentRoot "F:BilinCMS"
   ServerName localhost 
   <Directory "F:BilinCMS" >
     Require all granted
   </Directory>
</VirtualHost>

3、再回到httpd.conf文件下去掉Include conf/extra/httpd-vhosts.conf前面的;

4、重启Apache服务器,OK!

原文地址:https://www.cnblogs.com/yxpblog/p/4381566.html