【问题标题】:How to access http://localhost/~username/Sites folder from iPhone which is connected to the same network如何从连接到同一网络的 iPhone 访问 http://localhost/~username/Sites 文件夹
【发布时间】:2020-09-13 23:32:20
【问题描述】:

我没有使用 WAMP 或 MAMP,我只是使用 mac 上的内置 Web 服务器。我的所有网站都在http://192.xxx.x.x/~username/Sites 文件夹上开发,需要在我的 iPhone 中访问其中的一些。

我找到了我的 mac 的 IP 地址 (192.xxx.x.x) 并在我的 iPhone 上输入了它,它工作正常。但是当我输入http://192.xxx.x.x/~username/Sites 时,它会说,

Forbidden, you don't have permission to access this resource.

这和防火墙有关吗?

【问题讨论】:

    标签: macos apache localhost webserver


    【解决方案1】:

    可能是因为权限问题, 你应该检查你的etc/apache2/users那里检查username.conf

    如果没有 username.conf ,请获取您的短用户名并创建一个文件 shortusername.conf。 使用 whoami 获取短用户名,例如我的用户名是 San create San.conf at that location.. 使用 sudo nano shortusername.conf 编辑文件并添加此位

    <Directory "/Users/username/Sites/">
    AllowOverride All
    Options Indexes MultiViews FollowSymLinks
    Require all granted
    </Directory>
    

    现在通过以下方式重新启动您的服务器: sudo apachectl restart 这对我有用...

    【讨论】:

      猜你喜欢
      • 2011-08-05
      • 2018-10-28
      • 2013-01-06
      • 2012-12-11
      • 2023-04-02
      • 2012-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多