……………………window…………………………
环境:xampp7.3.5
1、配置host
在windows中,有一个文件:C:\Windows\System32\drivers\etc\host
添加
127.0.0.1 host.hahaha.com
2、配置
在D:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost 127.0.0.1:80>
ServerAdmin [email protected]
DocumentRoot "D:/xampp/htdocs/"
ServerName host.hahaha.com
</VirtualHost>
……………………Linux…………………………
(未测试)
1、配置hosts文件
在ubuntu里面(一般linux都如此),则是在/etc下查找hosts文件,这个就是相当于那个host文件一样的存在。如果没有的话,就自己新建一个。