xampp內建apache服務器,也是能夠配置vhosts的web
1. 打開httpd.conf文件,搜索vhostsapache
發現這句話:服務器
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2. 找到httpd-vhosts.conf文件app
打開,代碼以下:spa
##<VirtualHost *:80> ##ServerAdmin webmaster@dummy-host2.example.com ##DocumentRoot "D:/xampp/htdocs/dummy-host2.example.com" ##ServerName dummy-host2.example.com ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common ##</VirtualHost>
都是註釋的,取消註釋,而後配置一下域名,好比個人域名爲lumen.app
配置以下:code
<VirtualHost *:80> ServerAdmin jaynaruto@qq.com DocumentRoot "D:/xampp/htdocs/lumen/public" ServerName lumen.app ##ServerAlias www.dummy-host.example.com ErrorLog "logs/lumen.app-error.log" CustomLog "logs/lumen.app-access.log" common </VirtualHost>
3. 固然最後須要在hosts文件中新增一條記錄:blog
127.0.0.1 lumen.app