Logo Background RSS

Install mod_limitipconn For Apache

  • Installing mod_limitipconn.c :o

    This is the distribution page for the Apache module mod_limitipconn.c, which
    allows web server administrators to limit the number of simultaneous
    downloads permitted from a single IP address.

    Why did I write this module? Well, I run an mp3 server which since its
    inception was being constantly hosed by people who were trying to download
    dozens of files at once. For months I scoured the Internet looking for a
    code snippet that would solve this problem. The closest thing I found was this
    patch against an old version of Apache, and it didn’t run properly on my Linux box
    (that was back then; nowadays, the patch doesn’t even apply cleanly to the
    Apache source tree).

    Finally I gave up and decided to write something to do the job myself, and
    here’s the result.
    =================
    Log into ssh

    (Apache 1.3.x) -
    cd /usr/src
    http://dominia.org/djao/limit/mod_limitipconn-0.04.tar.gz
    tar xzvf mod_limitipconn-0.04.tar.gz
    cd mod_limitipconn-0.04

    (Apache 2.0.x)
    cd /usr/src
    http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz
    tar xzvf mod_limitipconn-0.22.tar.gz
    cd mod_limitipconn-0.22

    pico Makefile
    find the line that reads APXS=apxs
    change that to
    APXS=/usr/local/apache/bin/apxs

    press cntrl O to save
    then cntrl X

    // if your locations to apxs is different
    locate apxs and copy the path
    then paste that in
    //

    make
    make install

    service httpd restart

    pico -w /etc/httpd/conf/httpd.conf

    locate ExtendedStatus
    Make sure ExtendedStatus is on and without the comment at the start

    and add this line to every virtual directory you want to limit
    or add it once to the main directory to limit all

    MaxConnPerIP 3
    # exempting images from the connection limit is often a good
    # idea if your web page has lots of inline images, since these
    # pages often generate a flurry of concurrent image requests
    NoIPLimit image/*

    MaxConnPerIP 1
    # In this case, all MIME types other than audio/mpeg and video*
    # are exempt from the limit check
    OnlyIPLimit audio/mpeg video

    press cntrl O to save
    then cntrl X
    then service

    httpd restart
    :D When i try it i have limit /download location and works really good. so dude enjoy :)

  1. #1 custom idx solutions
    January 2nd, 2012 at 11:09 pm

    This is great and will really help in downloading files. It will make it a bit easy and fast to download files even if there are so many other people doing so.

    Post ReplyPost Reply
Leave a Comment