我无法使用 ServerName 访问我的虚拟主机

发布于 2025-01-03 11:06:16 字数 510 浏览 1 评论 0原文

我已经在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

像极了他 2025-01-10 11:06:16

您可能需要编辑 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文