wampserver 本地虚拟主机配置

1、打开Apache配置文件httpd.conf

2、启用httpd-vhosts.conf(去掉Include conf/extra/httpd-vhosts.conf前面的注释)

3、然后编辑httpd-vhosts.conf(在D:\wamp\bin\apache\Apache2.2.21\conf\extra\)

4、配置虚拟主机

<VirtualHost *:80>
    DocumentRoot "D:/wamp/www/weibo/weibo"           #网站目录,如果在www目录下的php目录,下面就填写F:/www/php
    ServerName myweibo.com                    #域名
    DirectoryIndex index.html index.htm index.php      #默认主页
    <Directory />
    Options FollowSymLinks
    AllowOverride None                      #不允许别人修改我们的页面
    order allow,deny                      #设置访问权限
    Allow from all
    </Directory>
</VirtualHost>

5、修改本机C:\Windows\System32\drivers\etc\hosts文件,添加

127.0.0.1   myweibo.com

 

posted @ 2014-12-09 09:35  捅了个浆糊  阅读(364)  评论(0编辑  收藏  举报