Home  >  Article  >  Backend Development  >  解析wamp5下虚拟机配置文档_php技巧

解析wamp5下虚拟机配置文档_php技巧

WBOY
WBOYOriginal
2016-05-17 08:58:31753browse

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

2.编辑wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf文件,在文件底部加入以下代码

ServerName dz1.test.com
ServerAlias dz1.test.com
DocumentRoot "e:/wamp/www/dz1"

另外加上这句以后,如果没有下面这句的记得加上,不然打localhost打不开最好再加上

ServerName localhost
ServerAlias localhost
DocumentRoot "D:/wamp/www"

3.编辑E:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf文件,在文件底部加入以下代码
注:不加此代码会报403错误
打开配置文件httpd.conf,并去掉#Include 0conf/extra/httpd-vhosts.conf前面的#号!!
e:/wamp/www/dz1">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all

重启Apache,然后测试dz1.test.com,就可以了。
。。。。。。。。。。。。。。。。
注意红色加粗的部分,必须相同,且文件存在

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn