Configure the speed limit function of apache2.4 in Ubuntu

Source: Internet
Author: User

The process is written as scripts, and the principles are all written in comments. One-click operation is sudo bash xxx. sh.

#! /Bin/bash # cd create the configuration file cd/tmp (cat <EOF <Directory/home/hursing/mylimiteddir/> SetOutputFilter RATE_LIMIT SetEnv rate-limit 30 </Directory> EOF)> ratelimit. conf # The number next to SetEnv rate-limit is the speed limit, measured in KB. Directory indicates which Directory to restrict # create a configuration file. If you manually create a conf file and write the content between two EOF # copy it. All available modules sudo cp ratelimit are placed in the directory of the mod-available Directory. conf/etc/apache2/mod-available/# Put all enabled modules in the directory of "mod-enabled", all of which are soft links, you can use ls-l to see that cd/etc/apache2/mod-enabled # ratelimit is the speed limiting module, and the load suffix file stores the so library path, the conf suffix file configures sudo ln-s for the module .. /mod-available/ratelimit. load. sudo ln-s .. /mod-available/ratelimit. conf. # restart the service to activate sudo service apache2 restart

Some Supplements: Directory labels can be replaced with other tags, such as Location, indicating a specific url. If you do not add a label, it is set globally. You can set multiple tags for different directories. The speed value cannot be decimal.

Ratelimit is added only in version 2.4. Reference http://httpd.apache.org/docs/2.4/mod/mod_ratelimit.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.