1.配置本地host文件:

apache 给网站配置域名

2.配置httpd-vhosts.conf 文件:

apache 给网站配置域名

3.配置httpd.conf文件:

打开 Apache 的 httpd.conf 文件(如:D:\wamp\bin\apache\apache2.4.9\conf), 添加如下代码:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
如果已存在,将Include前面的#去掉;

apache 给网站配置域名

4.重启apache服务

测试:

apache 给网站配置域名

 

相关文章: