phpstudy多站点配置

本文详细介绍如何通过修改hosts文件和Apache配置文件,实现本地环境下的虚拟主机设置。具体步骤包括:在hosts文件中添加IP和域名对应关系;启用httpd-vhosts.conf文件;在该文件中配置虚拟主机相关信息。
1.在 hosts文件添加ip和域名对应关系:
2.将httpd.conf中的Include conf/extra/httpd-vhosts.conf打开(去掉前头的#):
3.在httpd-vhosts.conf中添加以下内容,路径改一下:
<VirtualHost *:80>
ServerName www.swxtest.com
DocumentRoot "E:\phpstudy\swx"
<Directory "E:\phpstudy\swx">
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
allow from all
Require all granted
DirectoryIndex index.php index.php3 index.html index.htm
</Directory>
</VirtualHost>
 
然后就可以了~:

转载于:https://www.cnblogs.com/weixiaofantasy/p/10097546.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值