限制apache2的连接数

在debian下安装:
#apt-get install libapache-mod-limitipconn
 
不知道安装到什么地方了
 find / -name mod_limitipconn.so
/usr/lib/apache/1.3/mod_limitipconn.so
居然在1.3的目录下,复制到apache2的目录中
cp /usr/lib/apache/1.3/mod_limitipconn.so /usr/lib/apache2/modules/
 
修改apache2配置文件
nano /etc/apache2/httpd.conf
在最下面添加

ExtendedStatus On
LoadModule limitipconn_module modules/mod_limitipconn.so

重新启动/etc/init.d/apache2 restart
失败。。。
屏蔽LoadModule limitipconn_module modules/mod_limitipconn.so
正常
看来这个mod不直接支持apache2。。。。。。。
 
不过在官方的确写了安装方法,但是需要重新编译:(
 
Installation
The instructions below are written for Apache 2.0.39 since that’s what I had when I wrote the module, but they will also work with any later version of Apache 2.0.
Instructions for statically compiling mod_limitipconn into httpd:
 
tar xzvf httpd-2.0.39.tar.gz
tar xzvf mod_limitipconn-0.22.tar.gz
cd httpd-2.0.39
./configure –with-module=aaa:../mod_limitipconn-0.22/mod_limitipconn.c
make
make install
Instructions for building as a Dynamic Shared Object (DSO):
 
tar xzvf mod_limitipconn-0.22.tar.gz
cd mod_limitipconn-0.22
make install
Instructions for building static httpd with proxy tracking:
 
tar xzvf httpd-2.0.39.tar.gz
tar xzvf mod_limitipconn-0.22.tar.gz
cd httpd-2.0.39
patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff
./buildconf
./configure –enable-forward –with-module=aaa:../mod_limitipconn-0.22/mod_limitipconn.c
make
make install
Instructions for building DSO with proxy tracking:
 
tar xzvf httpd-2.0.39.tar.gz
tar xzvf mod_limitipconn-0.22.tar.gz
cd httpd-2.0.39
patch -p1 < ../mod_limitipconn-0.22/apachesrc.diff
./buildconf
./configure –enable-forward
make
make install
cd ../mod_limitipconn-0.22
PATH=/usr/local/apache2/bin:$PATH make install

One thought on “限制apache2的连接数

  1. Kingmax Yang

    你好,昨晚搞了一晚没有成功,最后重新编译一个APACHE就成功了,但是重新编译好麻烦,之前搞好装好的东西又不能用,有没有其它比较好的办法,在ubuntu下用回apt-get的apache2,又能用这个模块?
    如果你有好的解决办法可以发到我邮箱,谢谢!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *