解析wamp5下虚拟机配置文档

网络编程 2021-07-05 09:49www.168986.cn编程入门
本篇文章是对wamp5下虚拟机配置文档的方法进行了详细的分析介绍,需要的朋友参考下

Wamp下,虚拟机配置分为三个步骤,实例如下:
1.修改Hosts文件
C:\WINDOWS\system32\drivers\etc\Hosts
127.0.0.1 dz1.test.

2.编辑wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf文件,在文件底部加入以下代码
<VirtualHost *:80>
ServerName dz1.test.
ServerAlias dz1.test.
DocumentRoot "e:/wamp//dz1"
</VirtualHost>

另外加上这句以后,如果没有狼蚁网站SEO优化这句的记得加上,不然打localhost打不开最好再加上
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "D:/wamp/"
</VirtualHost>

3.编辑E:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf文件,在文件底部加入以下代码
注:不加此代码会报403错误
打开配置文件httpd.conf,并去掉#Include 0conf/extra/httpd-vhosts.conf前面的#号!!
<Directory "e:/wamp//dz1">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
重启Apache,然后测试dz1.test.,就可以了。
。。。。。。。。。。。。。。。。
注意红色加粗的部分,必须相同,且文件存在

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by