Apache Ab安装

作者: peteLee | 来源:发表于2018-03-22 10:48 被阅读0次

Apache ab 安装

环境:CentOS7

一、卸载自己带httpd

1 查看服务

  • 查看是否有httpd进程正在运行
    ps -ef | grep httpd
  • 查看linux系统服务中有没有httpd
    chkconfig --list

2 如果存在

  • 关闭httpd服务自启动
    chkconfig httpd off
  • 停止httpd服务
    service httpd stop
    停止后查看进程processor,如果依然有httpd,手动kill掉
    ps -ef | grep httpd
    kill -9 pid
  • 卸载httpd软件
    先检查安装包的名字
    rpm -qa|grep httpd
    根据名字删除包
    rpm -e httpd-tools-2.4...
  • 删除httpd.conf文件
    先检查文件在哪
    find / -name httpd.conf
    查出之后根据路径把它删了
    rm /xxx/xxx/httpd.conf

二、安装GCC

# yum install gcc-c++

安装完后查看

# gcc -v

三、所需软件下载

四、环境准备

1、APR

# mkdir /usr/local/apr
# tar -zxf apr-1.6.2.tar.gz
# cd apr-1.6.2
# ./configure --prefix=/usr/local/apr
# make
# make install

2、ARP-Util

# mkdir /usr/local/apr-util
# tar -zxf apr-util-xxx
# cd apr-util-xxx
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
# make
# make install

可能会报错:
xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录
执行:

# yum install expat-devel

3、PCRE

# mkdir /usr/local/pcre
# tar -zxf pcre-xxx
# cd ../pcre-xxx
# ./configure --prefix=/usr/local/pcre --with-apr=/usr/local/apr/bin/apr-1-config
# make
# make install

4、HTTPD

# mkdir /usr/local/httpd
# tar -zxf httpd-2.2.34.tar.gz
# cd ../httpd-xxx
# ./configure --prefix=/usr/local/httpd --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
# make
# make install

五、安装

# yum list httpd

发现可安装的软件包:httpd.x86_64

# yum install httpd.x86_64

六、启动

1、配置文件

# vim /usr/local/httpd/conf/httpd.conf

增加:

ServerName 127.0.0.1:80

2、设置为系统启动

apachectl 复制到系统启动目录下并命名为httpd:

# cp /usr/local/httpd/bin/apachectl /etc/rc.d/init.d/httpd

chkconfig来注册apache服务,并其可以在linux的服务列表中看到(chkconfig –list):

#  vim /etc/rc.d/init.d/httpd

增加:

#!/bin/sh
# chkconfig:35 61 61
# description:Apache

将httpd配置自启并加入linux服务监控:

# chkconfig --add httpd

七、然后

你就可以 ab -n 100 -c 10 http://www.baidu.com/index.html

参考:
http://blog.csdn.net/u010297957/article/details/50751656
http://www.cnblogs.com/zhuque/archive/2012/11/03/2763352.html

相关文章

  • 几款常用压测工具使用小结

    ab ab是apache自带的压力测试工具,使用起来非常方便. 安装 如果安装了apache, 那么ab已经安装好...

  • ab和siege

    ab和siege ab 简介 Apache Benchmark(简称ab) 是Apache安装包中自带的压力测试工...

  • ab压力测试

    一、ab安装与介绍 Apache Benchmark(简称ab) 是Apache安装包中自带的压力测试工具 ,简单...

  • ab测试

    安装ab工具 ubuntu安装ab apt-get install apache2-utils centos安装a...

  • 使用 apache bench(ab)进行压力测试

    使用 apache bench(ab)进行压力测试 安装 centos安装apache benchsudo yum...

  • Linux环境下 ab压力测试

    Linux下搭建ab环境 1.安装Apache 2.如果不想安装apache但是又想使用ab命令的话,我们可以直接...

  • AB 测试工具

    Apache轻量级性能工具 此文简单介绍一下ab的工具使用与结果分析。 安装:要使用AB,需要先安装Apache,...

  • Apache Ab安装

    Apache ab 安装 一、卸载自己带httpd 1 查看服务 查看是否有httpd进程正在运行ps -ef |...

  • ab(Apache Benchmark)

    【测试环境的安装】 【ab】 ab就是Apache Benchmark的缩写,顾名思义它是Apache组织开发的一...

  • 压力测试常用指标与测试工具ab

    ab测试工具的全称是Apache Bench,是Apache下的一个工具。所以要利用ab,首先要安装Apache,...

网友评论

    本文标题:Apache Ab安装

    本文链接:https://www.haomeiwen.com/subject/azohqftx.html