云服务器 性能测试之web压力测试,web压力测试
前言:现在云服务器是主流,成了许多中小型公司的首选服务器,但是云服务器都是虚拟机,所以性能是一大疑问,这里就开始简单介绍云服务器的性能测试,云端web服务器的压力测试。
Linux下常用的四款Web服务器压力测试工具(http_load、webbench、ab、siege),这里采用apache自带的ab工具来测试。
1,开始安装apache
前期准备:
yum install gcc* -y
yum install libtool* -y
1.1,去官网下载
apache,http://httpd.apache.org/download.cgi#apache24
下载软件包是:httpd-2.4.12.tar.gz
解压tar -zxvf httpd-2.2.6.tar.gz,完成之后,会在当前目录出现一个httpd-2.2.6目录,然后顺序执行如下命令改名:
tar -zxvf httpd-2.2.6.tar.gz
mv httpd-2.2.6 apache
cd apache
设置安装参数,命令如下:
./configure –prefix=/usr/local/apache2 –enable-module=so –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util
[root@bwebhttpd-2.4.12]# ./configure --prefix=/usr/local/apache2 --enable-module=so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
[root@bwebhttpd-2.4.12]#
<版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!>
原博客地址: http://blog.csdn.net/mchdba/article/details/46381741
原作者:黄杉 (mchdba)
报错APR…问题
1.2 解决apr not found问题
去http://apr.apache.org/download.cgi下载
wget http://archive.apache.org/dist/apr/apr-1.4.6.tar.gz,然后源码安装
[root@bwebdata]# cd apr-1.4.6
[root@bwebapr-1.4.6]# ./configure --prefix=/usr/local/apr
[root@bwebapr-1.4.6]# make
[root@bwebapr-1.4.6]# make install
1.3.解决APR-util not found问题
需要安装apr-util组件:
[root@bwebdata]# wget http://apache.fayea.com//apr/apr-util-1.5.4.tar.gz
[root@bwebdata]# tar -xvf apr-util-1.5.4.tar.gz
[root@bwebdata]# cd apr-util-1.5.4
[root@bwebapr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
[root@bwebapr-util-1.5.4]# make
[root@bwebapr-util-1.5.4]# make install
或者 yum install -y apr-util*
1.4 configure: error: pcre-config for libpcre not found问题
../configure添加了–with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util仍提示 configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/的错误
查看下是否有pcre参数
[root@bwebhttpd-2.4.12]# ./configure -help | grep pcre
–with-pcre=PATH Use external PCRE library
[root@bwebhttpd-2.4.12]#
没有这个参数,所以需要重新下载安装:
下载pcre,下载地址一:http://sourceforge.net/projects/pcre 下载地址二:http://ftp.exim.llorien.org/pcre/
[root@bwebdata]# wget http://ftp.exim.llorien.org/pcre/pcre-8.36.tar.gz
--这里因为下载失败,所以重新去csdn资源库下载了pcre的zip包
[root@bwebdata]# unzip pcre-8.36.zip
[root@bwebdata]# cd pcre-8.36
[root@bwebpcre-8.36]# ./configure --prefix=/usr/local/pcre
[root@bwebpcre-8.36]# make
[root@bwebpcre-8.36]# make install
或者 yum安装也可以:
[root@bwebhttpd-2.4.12]# yum install -y pcre*
必要的组件安装完了,我们可以继续源码编译apache了
2 最后编译安装apache
[root@bwebhttpd-2.4.12]# ./configure --prefix=/usr/local/apache2 --enable-module=so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-included-apr
[root@bwebhttpd-2.4.12]# make
[root@bwebhttpd-2.4.12]# make install
启动apache
/usr/local/apache2/bin/apachectl start
[root@bwebhttpd-2.4

