一、打开Apache配置文件httpd.confphp
二、启用httpd-vhosts.conf(去掉Include conf/extra/httpd-vhosts.conf前面的注释)html
三、而后编辑httpd-vhosts.conf(在D:\wamp\bin\apache\Apache2.2.21\conf\extra\)apache
四、配置虚拟主机ide
<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>
五、修改本机C:\Windows\System32\drivers\etc\hosts文件,添加网站
127.0.0.1 myweibo.com