设置Apache监听多个端口

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

    Listen localhost:8033
    Listen localhost:8083

    .......

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

<VirtualHost *:8033>
   DocumentRoot "F:\wamp\www"
   ServerName localhost 
    <Directory "F:\wamp\www" >
    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!

 

posted @ 2015-03-31 17:29  记忆书签  阅读(3783)  评论(0编辑  收藏  举报