[英]Apache 2.4: Allow access from the local network only
我在 windows 10 上有一个 web 页面,在我的计算机上运行 Apache 2.4 和 wamp 服务器。 我想配置 Apache 以便给定的虚拟主机仅在 local.network 内部可见,到目前为止我们的本地计算机可以通过以下设置访问我的页面:
# Virtual Hosts
#
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 10.1.1
</Directory>
</VirtualHost>
最近,当我使用 ipconfig 检查时,我们的办公室被分为 2 个独立的办公室(不同的位置),但用于.network。 第二个办公室仍然使用与第一个相同的域。 如何在apache配置,让第二办公室的本地电脑可以访问该网页?
从第一个办公室的计算机中获取示例 ipconfig。
Connection-specific DNS Suffix . : domain.office.com
IPv4 Address. . . . . . . . . . . : 10.1.1.***
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.1.1.250
从第二个办公室的计算机中获取示例 ipconfig。
Connection-specific DNS Suffix . : domain.office.com
IPv4 Address. . . . . . . . . . . : 10.99.4.**
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Default Gateway . . . . . . . . . : 10.99.5.254
我注意到 su.net 掩码也有差异..
添加以下内容:
# Virtual Hosts
#
<VirtualHost *:8080>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
# Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 10.1.1
Require ip 10.99.4
</Directory>
</VirtualHost>
使用 CIDR 表示法:需要 ip 10.99.4.0/23
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.