XAMPP 中配置仅允许特定 MAC 地址的设备访问
在 XAMPP 中配置仅允许特定 MAC 地址的设备访问,最直接有效的方式是使用 Apache 的 mod_authz_host
模块结合 MAC 地址过滤。以下是简单实用的配置步骤:
操作步骤(Windows/Linux 通用)
-
获取允许访问的 MAC 地址
# Windows ipconfig /all | findstr "Physical Address"# Linux ifconfig | grep ether
记录需要允许的 MAC 地址(格式如
00-1A-2B-3C-4D-5E
) -
修改 Apache 配置文件
打开xampp/apache/conf/httpd.conf
,在文件末尾添加:<Location />Require all deniedRequire mac 00-1A-2B-3C-4D-5E # 替换为你的MACRequire mac AA-BB-CC-DD-EE-FF # 添加更多MAC </Location>