Apache:IP连接起作用,但不起作用
今天早些时候,我通过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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将“收听”设置设置为特定的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.