我无法使用 ServerName 访问我的虚拟主机
我已经在 apache 配置文件的末尾创建了虚拟主机添加代码。
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:\wamp\www"
ServerName Name_of_server
ErrorLog "logs/error.log"
CustomLog "logs/log.log" common
</VirtualHost>
我需要使用地址 http://Name_of_server 访问它,但网络浏览器找不到“Name_of_server”,本地主机仍在工作。
I have created virtual host addind code below to the end of config file of apache.
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:\wamp\www"
ServerName Name_of_server
ErrorLog "logs/error.log"
CustomLog "logs/log.log" common
</VirtualHost>
I need to access it with adress http://Name_of_server but web borowser can't find "Name_of_server", localhost is still working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要编辑
c:\windows\system32\driver\etc\hosts
下的主机配置,或者您需要访问域名提供商以指向服务器的 IP 地址(如果您有)静态IP。you may need to edit your hosts config under the
c:\windows\system32\driver\etc\hosts
or you need to access your domain name provider to point to the IP address of your server if you have a static IP.