使用 .htaccess 或类似的子域限制外部连接?
我正在托管一个 Web 应用程序,该应用程序提供以不同时间间隔刷新的静态 html 页面。有些甚至每 30 秒一次。我目前有许多(数百个)独特的页面,可以通过 300 个独特的子域访问。我的一些客户的独特页面最多有 50 名访问者,并且需要每 30 秒刷新一次,没有任何问题。其他客户的页面访问量高达 1000 名或更多。这些客户端正在降低我的服务器的性能。
注册时没有预先设定的限制,但我现在需要施加这样的限制才能维持财务状况。
为此,我想为我的托管帐户中的每个子域定义允许的有限数量的连接。尝试超出此有限值范围的连接应被拒绝或重定向。我可以完全访问 .htaccess 和 php.ini。
我的解决方案看起来可行吗?如果是这样,您能给我指出一个实施此示例或指南或任何其他可能帮助我解决问题的材料吗?
I am hosting a web application that serves static html pages that are refreshed at various intervals. Some as often as every 30 secs. I currently have numerous (hundreds) of unique pages that are accessed via 300 unique subdomains. Some of my clients have at most 50 visitors to their unique page(s) and need refreshes every 30 secs, without problems. Other clients have up to a 1000 or more visitors to their page(s). These clients are reducing the performance of my server.
There was no predefined limit upon signup, but I now need to impose such a limit to remain afloat financially.
To do this, I would like to define a finite number of connections allowed for each individual subdomain in my hosting account. Connections attempted out of range of this finite value should either be rejected or redirected. I have full access to .htaccess and php.ini.
Does my solution seem feasible? If so, can you point me to an example or guide to implement this or any other material that may help me in my problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定您对 1and1 有什么控制权来安装 Apache 模块,或者您当前正在运行哪些版本/模块,但我认为您要求能够在每个虚拟主机的基础上限制资源,如果是这种情况,可能< a href="https://serverfault.com/questions/48843/apache-bandwidth-limiting-based-on-url">https://serverfault.com/questions/48843/apache-bandwidth-limiting-based-on -url 将会有用。
I am not sure what control you have with 1and1 for installing modules for Apache or what versions/modules you currently have running but I think you are asking to be able to limit resources on a per virtual host basis, if this is the case maybe https://serverfault.com/questions/48843/apache-bandwidth-limiting-based-on-url will be of use.