如何在WampServer中Apache配置虚拟主机方法
1、Host文件是用于DNS解析,本地的host文件优于网络上的DNS解析。找到目录C:\Windows\System32\drivers\etc下的host文件,用记事本打开在后面添加一行 127.0.0.1 www.test.com。

4、找到Apach下的httpd-vhosts.conf 一般是在apach安装目录下的conf目录下(如:C:\wamp64\bin\apache\apache2.4.23\conf\extra)
5、在httpd-vhosts.conf文件里添加如下代码<VirtualHost *:80> #网站根目录 Document伊怕锱鳏Root "F:/test" #域名 ServerName www.test.com #这里配置欢迎首页面 DirectoryIndex index.html index.htm index.php <Directory /> Options FollowSymLinks #不允许别人修改我们的页面 AllowOverride None #设置访问权限 order allow,deny Allow from all </Directory> </VirtualHost>

7、在浏览器输入自己设置的域名,出现如下说明设置成功。

9、找到下面的代码<Dire罕铞泱殳ctory /> AllowOverride none Requ足毂忍珩ire all denied</Directory>将它改为:<Directory /> AllowOverride none Require all granted</Directory>就可以了

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:87
阅读量:45
阅读量:48
阅读量:52
阅读量:83