wampsever配置虚拟主机

来源:互联网 发布:如何开发一门编程语言 编辑:程序博客网 时间:2024/06/01 10:09

我使用的环境是win7,wampserver3.0.6

步骤

第一步:在这个文件下下面设置

 

添加127.0.0.1 www.phpexcelstudy.com

 

第二步:

更改apache的配置文件,开启服务

去掉LoadModule rewrite_module modules/mod_rewrite.so

Include conf/extra/httpd-vhosts.conf这两句前面的注释

 

 

第三步:

E:\wamp64\bin\apache\apache2.4.23\conf\extra目录下httpd-vhosts.conf里面配置

 

<VirtualHost *:8888>#里面这个8888是我之前配置的端口号

ServerName www.phpexcelstudy.com #域名

DocumentRoot E:\wamp64\www\phpexcelstudy  #网站根目录

DirectoryIndex index.html index.htm index.php  #欢迎首页

<Directory  "E:\wamp64\www\phpexcelstudy">

Options FollowSymLinks

AllowOverride None #不允许别人修改我们的页面

order allow,deny #设置访问权限

Allow from all

</Directory>

</VirtualHost>

第四步:

打开浏览器,访问:http://www.phpexcelstudy.com:8888/

因为之前端口冲突,我自己配了8888端口,根据自己的情况,端口号自己改,默认的是80端口