如何使用设备访问本地主机的部分内容

发布于 2025-01-05 20:39:41 字数 971 浏览 0 评论 0原文

我已将最新的稳定 MOODLE_21_STABLE 分支拉到我的 WAMP 服务器本地主机位置,所有安装和配置均已成功,可以像往常一样在浏览器中工作。我现在正在研究主题,并且想测试特定于设备的主题。

所以问题帮助我通过 iPhone Safari 和 Android Chrome 成功连接到我的本地主机,我可以导航本地主机上的各种项目和工具 - 所有这些都非常有效(成功的 URL 例如: http://192.168.123.135/ - 这是根 WAMP 页面)。

接下来,我尝试通过 Safari 访问我的 Moodle 安装(参考 URL:http://192.168.123.135/ moodle/moodle2/htdocs/),但 Safari 提示错误:

“无法打开页面。Safari 无法打开该页面,因为它可能无法连接到服务器。”

提示下方的页面显示:

“检测到不正确的访问,该服务器只能通过‘http://localhost/moodle/moodle212/htdocs’地址访问,抱歉。请通知服务器管理员。”

需要注意两件事:

  • 当我尝试输入失败的 Moodle URL 时,Safari 会在提示错误时将 URL 的 IP 地址部分重新写入“localhost”。我自己的项目 URL 保留其 IP 部分。
  • 页面错误中的上述“建议”地址也再次传递相同的错误消息。

我觉得我离这里的精彩只有几英寸的距离,有没有人对我在通过设备浏览时如何访问 WAMP 本地主机(或类似的)上的 Moodle 安装有任何建议/想法?

我需要禁用/启用某些服务器设置吗?

这可能是 Moodle 特定的问题,还是以这种方式访问​​服务器位置很麻烦/不可能?

I've pulled the latest stable MOODLE_21_STABLE branch to my WAMP server localhost location, all installed and configured successfully, works in browsers as per usual. I'm poking around theming now, and would like to test out device-specific themes.

SO questions helped me successfully connect to my localhost via iPhone Safari and Android Chrome, I can navigate the various projects and tools I have on localhost - all of that works wonderfully (successful URL eg: http://192.168.123.135/ - this is the root WAMP page).

Next, I tried to access my Moodle install via Safari (URL for reference: http://192.168.123.135/moodle/moodle2/htdocs/), but Safari prompts an error:

"Cannot Open Page. Safari cannot open the page because it could not connect to the server."

The page beneath the prompt reads:

"Incorrect access detected, this server may be accessed only through 'http://localhost/moodle/moodle212/htdocs' address, sorry. Please notify server administrator."

Two things to note:

  • Safari re-writes the IP address portion of the URL to 'localhost' for the failed Moodle URLs I've been trying to enter, when it prompts the error. My own project URLs keep their IP portion.
  • The above 'suggested' address in the page error also delivers the same error message again.

I feel like I'm inches away from awesomeness here, does anyone have any advice/ideas as to how I can access my Moodle install on a WAMP localhost (or similar), when browsing via device?

Is there some server setting I need to dis/enable?

Is this likely to be a Moodle specific issue, or is there something about accessing server locations in this way that is troublesome/not possible?

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

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

发布评论

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

评论(1

彼岸花似海 2025-01-12 20:39:41

确保 WAMP 配置文件中的 $CFG->wwwroot 和 Apache 虚拟主机的 IP 地址均设置为 192.168.123.135。也可能是主机名。听起来您遇到了配置问题,内部和外部 DNS 名称的解析方式不完全相同。阿帕奇可能是罪魁祸首。

您指的是与 WAMP 安装在同一台计算机上的桌面 Safari 吗?

Make sure that both $CFG->wwwroot and the IP address of the Apache vhost in the WAMP configuration files are set to 192.168.123.135. Also possibly the hostname too. It sounds like you have a config issue with internal and external DNS names not resolving in quite the same way. Apache is probably the culprit.

Are you referring to desktop Safari installed on the same machine as WAMP?

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