XAMPP只允许特定的LAN设备访问



我希望允许特定设备(在本例中是一台特定的iPad(访问同一局域网上的计算机上的XAMPP。除了这台设备和服务器本身之外,我不希望任何其他设备能够访问localhost或其他任何设备。我能够找到在线启用局域网访问的方法,但据我所知,这可以允许同一网络上的任何人访问XAMPP,如果他们拥有服务器的IP。

如果您谈论的是xampp中的apache服务器,您可以使用这种解决方案:https://serverfault.com/questions/776252/allow-access-to-apache-server-from-only-one-ip-address

可以为集成的tomcat、MySQL等找到类似的解决方案。

如果您使用的是Apache 2.4,请确保加载authz_core模块

删除:

Order allow,deny
Deny from all
Allow from my.ip.add.res
and, in place of the deleted directives,

插入:

Require ip xxx.xxx.xxx.xxx
**If you are using Apache 2.2**, make sure that you LOAD the authz_host module,

删除:

Order allow,deny
Deny from all
Allow from my.ip.add.res
and, in place of the deleted directives,

插入:

Order Deny,Allow
Deny from all
Allow from xxx.xxx.xxx.xxx

这与请求的内容有点偏离主题,但请求凭据是一种简单有效的限制访问的方法,无需担心IP地址或MAC地址。

https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication

例如。https://stackoverflow.com/a/44560458/3196753

这可能无法满足某些安全要求(例如HIPAA、PCI(,但对于简单地将未经授权的人员拒之门外来说,它非常简单有效。

最新更新