WAMP 32在Windows 10计算机上运行,Apache服务器(2.4)设置为“在线”。可以从其他LAN计算机访问,但是当尝试从Internet访问服务器(使用公共IP号)时,会发出错误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>
BTW,在vhosts中有2个服务器可用,如何使用公共IP访问特定的服务器?
答案 0 :(得分:1)
关于您应该为您的目录添加的{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>
希望它可以帮到你