每个连接/ IP限制Apache代理上传速度? [英] Limit Apache Proxy upload speed per connection/ip?
问题描述
我看着和mod_bandwidth的mod_cban但他们不似乎满足了我的要求。
I looked at mod_bandwidth and mod_cban but they dont seem to satisfy my requirements.
我在Apache 2.2(mod_proxy的,proxy_http,proxy_connect)代理服务器。
I am running a proxy server with apache 2.2 (mod_proxy, proxy_http, proxy_connect).
我要限制客户端的上传速度。
I want to limit the "upload speed of the client".
这是在同一时间服务器的下载带宽,不应该受到限制。
This is at the same time server download bandwidth, which should not limited.
我希望它每个连接,甚至每个IP更好。
I want it per connection or even better per IP.
要使它可以理解的:用例是,我不使用我的代理服务器面具自己想坏人uplaoding坏数据不好的地方。当然,我有日志和一切,但我想安全的麻烦,并使其在首位没有吸引力。
To make it understandable: The use case is that I don't want bad people uplaoding bad data to bad places using my proxy server to "mask" themselves. Of course I have logs and everything but I want to safe the trouble and make it unattractive in the first place.
为了更好地理解这是我设置的图片:
For better understanding here is a picture of my setup:
当然红色箭头也可以指向左上角的箭头。
Of course the red arrow could also point to the upper left arrow.
我目前想在不同的端口在同一台服务器上启动Apache两次,用ProxyRemote将请求发送给其它代理。因此,在第二个代理,我可以排除节流本地主机。不过,我仍然需要一个解决方案来限制传入而不是传出带宽。我认识到,使用iptables。
I am currently thinking about starting apache two times on the same server on different ports and using ProxyRemote to send the request to the other proxy. So on the second proxy I can exclude localhost from the throttling. However I would still need a solution to limit incoming but not outgoing bandwidth. I could realise that with IPtables.
但说实话?必须有一个更好的办法。这里只是要。
But honestly? There must be a better way. There just has to.
推荐答案
在您的虚拟主机地址:
BandWidthModule On
ForceBandWidthModule On
BandWidth 192.168.0.0/24 0
BandWidth all 80000
其中, 0 192.168.0.0/24
应该是你的IP和子网的规则。 0意味着它得0节流(本地用户获得全面提速,你可以扩展这做这样的事情的国家,大学,等等)。带宽中的所有80000
意味着其他人被限制为80 000字节/秒。
Where 192.168.0.0/24 0
should be your IP and subnet rules. The 0 means it gets 0 throttling (local users get full speed, you could extend this to do things like a country, university, whatever).
BandWidth all 80000
means everyone else is limited to 80 000 bytes/s.
这篇关于每个连接/ IP限制Apache代理上传速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!