Linux环境下限制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

相关推荐