文章出處
文章列表
前面的話
本文將詳細介紹windows下wamp多域名的配置方法
修改hosts文件
hosts文件的位置:系統盤→“windows”→“System32”→“drivers”→“etc”

打開hosts,新加一條記錄:127.0.0.1 php.xiaohuochai.com

啟動apache虛擬主機功能
打開Apache的httpd.conf文件

使用Ctr+f 搜索vhost

修改的地方有兩處:
1、搜索到#LoadModule vhost_alias_module modules/mod_vhost_alias.so,將#刪除
2、搜索到#Include conf/extra/httpd-vhosts.conf,將#刪除
相當于解除了注釋,這樣就完成了虛擬主機服務的開啟
修改vhosts配置文件
修改httpd-vhosts.conf配置文件,添加如下記錄
<VirtualHost *:80> DocumentRoot "d:/wamp/www/public" ServerName php.xiaohuochai.com ErrorLog "logs/xiaohuochai.com-error.log" CustomLog "logs/xiaohuochai.com-access.log" common </VirtualHost>
最后,重啟apache服務,在瀏覽器輸入http://php.xiaohuochai.com/,能夠正常訪問,表明配置成功

文章列表
全站熱搜