我正在尝试使Apache Virtual Host正常工作,但它不会捕获域,而是在Internet上发布。
我已经在配置文件中启用了虚拟主机:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
我的httpd-vhosts.conf文件如下所示:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "//nas/Web Design/Sites"
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "//nas/Web Design/Sites/Fdn"
ServerName fdn.dk
ServerAlias www.fdn.dk
ErrorLog "logs/fdn/error.log"
CustomLog "logs/fdn/access.log" common
</VirtualHost>
http:// Localhost可以正常工作,但是当我键入fdn.dk或www.fdn.dk时,浏览器将尝试在Internet上找到该站点,而不是查看我的本地文件夹。
怎么了...??我试图在互联网上找到解决方案,但是没有运气。
我需要更改主机文件中的内容吗?
亲切的问候
是的,/etc/hosts
如果您使用具有该域名的操作系统,则需要将该域名添加到文件中。或C:\WINDOWS\system32\drivers\etc\hosts
如果您使用的是Windows。
记录示例: 127.0.0.1 www.fdn.dk
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句