下载:apache http://httpd.apache.org/download.cgi

安装apache需要安装组件APR and APR-Util包、PCRE包 下载:APR and APR-Util http://apr.apache.org/download.cgi 下载:PCRE http://www.pcre.org/

下载后上传服务器 1、安装组件 加压 tar -zxvf apr-1.6.5.tar.gz cd apr-1.6.5 ./configure --prefix=/usr/local/apr make && make install

tar -zxvf apr-util-1.6.1.tar.gz cd apr-util-1.6.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make && make install

tar -zxvf pcre-8.42.tar.gz cd pcre-8.42 ./configure --prefix=/usr/local/pcre --with-apr=/usr/local/apr make && make install

tar -zxvf httpd-2.4.38.tar.gz cd httpd-2.4.38/support/ 在编译前修改ab.c vi httpd-2.4.38/support/ab.c #define MAX_CONCURRENCY 100000 #(默认20000 修改为100000) cd .. ./configure --prefix=/usr/local/apache --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util make && make install

cd/usr/local/apache/bin ./ab -c 50000 -n 100000 http://192.168.2.11/index.html 压力测试5万并发10万连接数