【问题标题】:I can't access my WAMP 3.2.3 project from other devices我无法从其他设备访问我的 WAMP 3.2.3 项目
【发布时间】:2021-10-27 07:05:53
【问题描述】:

我在 WAMP v 3.2.3 中开发了一个具有完全不同虚拟主机的网站,它在我的本地计算机 (localhost) 上运行良好,但问题在于它通过 LAN 访问。我已经更改了它的 apache httpd-vhosts。来自

的conf文件
# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

#                     
<VirtualHost *:80>    //My required Virtual Host
    ServerName test
    DocumentRoot "c:/wamp64/www/project1/test/sites/">"
    <Directory  "c:/wamp64/www/project1/test/sites/">">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require Local
    </Directory>
</VirtualHost>

到:

 # Virtual Hosts
    #
    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>
    
    #                     
    <VirtualHost *:80>    //My required Virtual Host
        ServerName test
        DocumentRoot "c:/wamp64/www/project1/test/sites/">
        <Directory  "c:/wamp64/www/project1/test/sites/">
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
            Require all granted    //         <--change(Local to all granted)
                   
        </Directory>
    </VirtualHost>

并允许来自端口 80 的入站连接

问题仍然存在,我无法从任何其他设备访问我的项目。 它显示:

Forbidden
You don't have permission to access this resource
Apache/2.4.46 (Win64)PHP/7.3.21 Server at 192.168.43.*

问题出在哪里? 请帮忙。

【问题讨论】:

    标签: apache wamp


    【解决方案1】:

    您无需隐藏您的本地 IPv4 地址 192.168.43.*,全球有数百万台设备与您的 IPv4 地址相同,您本地网络之外的人无法与您的本地 IP 地址通信通过知道您的 IPv4 地址,这是不可能的。

    您似乎为端口 80 设置了多个虚拟主机。本地主机只需要一个。

    确保您的服务器计算机上的防火墙配置为允许 apache 通过。

    将您想要服务器的任何文件放在服务器计算机上的“www”文件夹中。

    使用以下配置设置并重新启动 apache 以加载新配置。

    在与服务器计算机连接到同一本地网络的任何设备上打开网络浏览器,即通过 wifi 连接到与服务器计算机相同的路由器的手机。

    在手机浏览器中输入服务器计算机 IPv4 地址,完成...

     <VirtualHost *:80>
    
          DocumentRoot ${INSTALL_DIR}/www
    
          <Directory ${INSTALL_DIR}/www>
            Require all granted
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
          </Directory>
    
        </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 2014-11-01
      • 2021-08-07
      • 2018-03-14
      • 2022-01-23
      • 2015-02-08
      • 1970-01-01
      • 2012-06-21
      • 2020-10-10
      • 2019-03-23
      相关资源
      最近更新 更多