【发布时间】: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.*
问题出在哪里? 请帮忙。
【问题讨论】: