xampp 虚拟机配置

目标:

本地某端口根目录映射到htdoc的一个位置

方法:

1.修改D:\xampp\apache\conf 下的httpd文件,给里面的virtual host增加监听端口

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 81
Listen 82

2.由httpd文件里面的配置可以看到,虚拟机的配置文件路径

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

3.去conf/extra/httpd-vhosts.conf增加虚拟机

NameVirtualHost *:82
<VirtualHost *:82>
    DocumentRoot "D:/xampp/htdocs/traffic-monitor"
</VirtualHost>

4.重启Apache 访问localhost:82 就可以啦

转载于:https://www.cnblogs.com/it-snail/p/3858127.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值