wamp怎么配置虚拟主机
一、找到目录C:\Windows\System32\drivers\etc下的host文件,用记事本打开在后面添加一行 127.0.0.1 www.test.com。
二、找到 目录D:\wamp\bin\apache\apache2.4.23\conf\httpd.conf文件,找到 #Include conf/extra/httpd-vhosts.conf这句话,将前面的#号去掉。
找到下面的代码 AllowOverride none Require all denied 将它改为: AllowOverride none Require all granted
三、找到 目录D:\wamp\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf文件添加如下代码:
<VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "d:/wamp/www/" ServerName localhost ErrorLog "logs/dummy-host2.example.com-error.log" CustomLog "logs/dummy-host2.example.com-access.log" common <Directory "d:/wamp/www/"> AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "d:/wamp/www/Discuz_X33/discuz/zhaoqibang_dev" ServerName www.test.com ErrorLog "logs/dummy-host2.example.com-error.log" CustomLog "logs/dummy-host2.example.com-access.log" common <Directory "d:/wamp/www/Discuz_X33/discuz/zhaoqibang_dev"> AllowOverride All Require all granted </Directory> </VirtualHost>
文章
总共 0 条评论