apache 2.4 配置多个端口监听的方法

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/deusomax/article/details/53022902
1.拷贝目录htdocs,为htdocs2,htdocs3,可以改index.html,以作区分
2.httpd.conf里添加listen端口Listen 8082 Listen 8083,放开httpd-vhosts.conf注释
3.httpd-vhosts.conf里添加
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs2">
    Order allow,deny
    Allow from all
</Directory>

<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs3">
    Order allow,deny
    Allow from all
</Directory>

<VirtualHost *:8082>
    DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs2"
    ServerName localhost
</VirtualHost>

<VirtualHost *:8083>
    DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs3"
    ServerName localhost
</VirtualHost>
4. 重启访问
展开阅读全文

没有更多推荐了,返回首页