Apache:IP连接起作用,但不起作用

发布于 2025-02-13 02:58:35 字数 585 浏览 0 评论 0原文

今天早些时候,我通过http:/localhost和ip地址成功连接到我的Apache服务器。我短暂地关闭了服务器,当我再次运行它时,我只能通过IP连接(从我的计算机以及网络中的其他连接)。

我检查了以确保我的ServerRoot和DocumentRoot分别为C:/Apache24和$ {SRVRoot}/HTDOC,以及我所有与服务器相关的文件都在HTDOC中。此外,我在Chrome和Firefox上验证了此问题(我还尝试清除缓存)。

关于如何解决此问题的任何建议将不胜感激。

以下是我在httpd.conf文件中引用的行(一起拼接):

Define SRVROOT "C:/Apache24"
ServerRoot "${SRVROOT}"

DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted

</Directory>

我很乐意详细说明我可能已经忽略的任何相关信息

Earlier today I successfully connected to my Apache server both via http:/localhost and IP address. I turned off the server briefly and when I ran it again, I was only able to connect via IP (which connects successfully from my computer as well as others in the network).

I checked to make sure that my ServerRoot and DocumentRoot were C:/Apache24 and ${SRVROOT}/htdocs respectively as well as that all my server-related files were in htdocs. Additionally, I verified this issue on both Chrome and Firefox (where I also tried clearing the cache).

Any suggestions regarding how to fix this would be greatly appreciated.

Here are the lines I referenced in my httpd.conf file (spliced together):

Define SRVROOT "C:/Apache24"
ServerRoot "${SRVROOT}"

DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted

</Directory>

I would be happy to elaborate on any pertinent information I may have neglected

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

驱逐舰岛风号 2025-02-20 02:58:36

通过将“收听”设置设置为特定的IP地址和端口,而不是端口,我阻止了计算机通过Localhost访问该站点。通过更新httpd.conf文件以读取“收听80”,我解决了此问题。

By setting the "Listen" setting to a specific IP address and port as opposed to a port, I stopped my computer from accessing the site via localhost. By updating the httpd.conf file to read "Listen 80" I resolved this issue.

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