【问题标题】:Using "http://localhost" instead of "http://xx.xx.xx.xx" on iPod on WAMP在 WAMP 上的 iPod 上使用“http://localhost”而不是“http://xx.xx.xx.xx”
【发布时间】:2012-07-14 13:42:14
【问题描述】:

我正在运行 Windows 7 并使用我的 iPod Touch 访问我的本地主机站点以在 WAMP 上进行测试。

我可以通过在 iPod 上的 Safari 中导航到我的机器 IP 来浏览我的本地主机站点,如下所示:http://10.0.0.100

我想知道是否可以改用http://localhost,以及如何实现。

非常感谢!!

【问题讨论】:

    标签: iphone localhost wampserver


    【解决方案1】:

    基本上,localhost 指的是 127.0.0.1 指的是 ipod 本身的环回 ip,因此除非您在 (DNS / hosts 文件)您的 ipod 用于解析连接设置中的域名,我不建议这样做。

    以下是更改 ipod 中的 hosts 文件所需的步骤(我已经警告过你,除非你知道自己在做什么,否则这不是一件好事)

    来源:https://discussions.apple.com/thread/2801892?start=0&tstart=0

    简单的解决方案:

    主机文件位于:/etc/hosts

    要编辑此文件,您需要通过 SSH 连接到您的设备,如果您知道如何直接执行此操作,只需使用 vi 或 nano 来编辑文件。从 windows 使用 WinSCP 通过 FTP(SSH) 访问文件系统。然后只需导航到 /etc/hosts 将文件下载到桌面,右键单击并用记事本打开它,将解析器添加到最后一行“192.168.0.100 testserver”,保存并用新文件替换原始文件。

    /etc/host -- 示例配置

    # Host Database
    
    #
    
    # localhost is used to configure the loopback interface
    
    # when the system is booting.  Do not change this entry.
    
    ##
    
    127.0.0.1              localhost
    
    255.255.255.255   broadcasthost
    
    ::1                        localhost
    
    192.168.0.100       testserver
    

    *要通过 SSH 连接到 ipod,它必须安装 OpenSSH,通常这需要越狱。

    【讨论】:

    • 谢谢,非常有帮助!!
    猜你喜欢
    • 2015-01-05
    • 2013-12-31
    • 2016-05-30
    • 2020-03-24
    • 1970-01-01
    • 2014-09-26
    • 1970-01-01
    • 2020-09-11
    • 2017-12-08
    相关资源
    最近更新 更多