網上的答案千篇一概,沒有一個能用的,真心懷疑這些做者有沒有本身試過他們的答案。ide
直接上答案:spa
打開 Apache/conf/extra/httpd-vhosts.confcode
修改ip
<VirtualHost _default_:80>
ServerName example.com
DocumentRoot "把這裏改爲你的document root"
<Directory "把這裏改爲你的document root">it
AllowOverride All Order allow,deny Allow from all
</Directory>
</VirtualHost>class
也有這樣的cli
總之吧DocumentRoot改過來就對了im
而後重啓一下Apache,就OK了hosts