Apache配置虚拟主机
更改两个文件
一、apache\conf\extra\httpd-vhosts.conf
##<VirtualHost *:80>
##ServerAdmin [email protected]
##DocumentRoot "D:/xampp/htdocs/dummy-host2.localhost"
##ServerName dummy-host2.localhost
##ServerAlias www.dummy-host2.localhost
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
##</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "D:/xampp/htdocs/ceshi.com"
ServerName ceshi.com
ServerAlias www.ceshi.com
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
二、C:\Windows\System32\drivers\etc\hosts
127.0.0.1 www.ceshi.com
这样就可以通过www.ceshi.com访问本地项目
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。