wampserver 本地虚拟主机配置

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

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

3、然后编辑httpd-vhosts.conf(在D:wampinapacheApache2.2.21confextra)

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:WindowsSystem32driversetchosts文件,添加

127.0.0.1   myweibo.com
原文地址:https://www.cnblogs.com/Tongjanghu/p/4152484.html