Apache配置虚拟主机无效
从配置虚拟主机开始:
- 先在系统盘里的host文件开始:
先添加一个域名:127.0.0.1 www.m.com - 打开httpd.conf文件,打开httpd-vhosts.conf:
# Virtual hosts Include conf/extra/httpd-vhosts.conf
3.然后打开httpd-vhosts.conf文件,配置一个虚拟主机:
DocumentRoot "D:/wamp/apache/htdocs" ServerName www.m.com
4.重启Apache,这时虚拟主机的域名www.m.com不能访问,还是it works状态;
#ServerName localhost:80
注释掉,重新启动apache即可!
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/223727.html原文链接:https://javaforall.net
