如何在iPad或iPhone上进行本地托管?

时间:2014-02-27 12:15:03

标签: wordpress ipad wamp ip-address wampserver

有人知道如何在iPad或iPhone上查看Wamp上的本地托管网站吗?我设法打开命令提示符,找到我的IP地址,192.168.1.18。然后我在我的iPad上的浏览器中输入了这个地址,但我收到错误"禁止"。

我怎样才能让它发挥作用?

1 个答案:

答案 0 :(得分:1)

试试这个

编辑您的httpd.conf文件,并查找此部分

<Directory "d:/wamp/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 localhost
</Directory>

现在将此更改为允许从您的IP访问

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 localhost 
    Allow from 192.168.1

注意我只使用了ip addres的4个部分中的前3个,这将允许从192.168.1.0到192.168.1.255范围内的任何IP地址进行访问。这是因为你的ipad会分配不同的ipaddress,这取决于你在任何时候连接的其他设备数量。

如果您使用的是WAMPServr 2.4,因此Apache 2.4.x的语法略有不同,您应该

Require local
Require ip 192.168.1 

Require local覆盖127.0.0.1 localhost以及IPV6 localhost等效:: 1。