3422e 发表于 2015-11-9 09:31:08

apache配置httpd-vhosts

1、打开 bin\apache\apache2.2.8\httpd.conf 中去掉

1
Include conf/extra/httpd-vhosts.conf




前的#号

2、打开 conf/extra/httpd-vhosts.conf 中添加

1
NameVirtualHost *:80




之后根据项目依照下面的格式来修改


1
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:/wamp/www/test"
ServerName test
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "D:/wamp/www/test">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>






3、打开 C:\WINDOWS\system32\drivers\etc\hosts 文件添加


1
127.0.0.1       test




注意:这是的网站名与httpd-vhost中的ServerName一直

4、最后重启apache,打开浏览器,输入http://test即可

页: [1]
查看完整版本: apache配置httpd-vhosts