WAMP&Vhosts。来自互联网= 403禁止
问题描述:
WAMP的32位Windows 10的机器上运行的访问,与Apache服务器(2.4)设置为 “在线”。可以从其他LAN计算机访问,但是当尝试从Internet访问服务器(使用公共IP地址)时,会发出403 /禁止的错误。WAMP&Vhosts。来自互联网= 403禁止
具有以下配置会发生(虚拟主机):
NameVirtualHost *
<VirtualHost *>
DocumentRoot "E:\Users\Rix\Offline Drive\wordpress"
ServerName localhost
<Directory "E:\Users\Rix\Offline Drive\wordpress">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
DocumentRoot "E:\Users\Rix\Offline Drive\WebG\Wordpress"
ServerName ghiandalocal
<Directory "E:\Users\Rix\Offline Drive\WebG\Wordpress">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
顺便说一句,在虚拟主机有2级可用的服务器,我怎么可以访问使用公网IP的特定的一个?
答
关于403错误,你应该加上:Require all granted
为您的目录。
关于2个服务器可获取的,你可以添加例如另一个端口,如:
Listen 80
Listen 81
<VirtualHost *:80>
DocumentRoot "E:\Users\Rix\Google Drive\Documents\Biz\Progetti\wordpress"
ServerName localhost
<Directory "E:\Users\Rix\Google Drive\Documents\Biz\Progetti\wordpress">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:81>
DocumentRoot "E:\Users\Rix\Offline Drive\Web Ghianda\Wordpress"
ServerName ghiandalocal
<Directory "E:\Users\Rix\Offline Drive\Web Ghianda\Wordpress">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
希望它可以帮助你
完美!谢谢! – Riccardo
欢迎您的支持 – Gaetan