35

Can you provide instuctions on how to install ab on a fedora distro with or without installing the apache web server? With yum or compiling from source.

4 Answers 4

24

Install apr-util(need to run ab):

yum install apr-util

Install yum-utils:

yum install yum-utils

Download httpd an extract ab:

mkdir ~/httpd
cd ~/httpd
yumdownloader httpd
rpm2cpio httpd-2.2.3-43.el5.centos.3.i386.rpm | cpio -idmv
mv usr/bin/ab /usr/bin/ab
cd ~
rm -rf ~/httpd

Run ab:

ab http://google.ru/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
2
  • 3
    On ubuntu you could do sudo apt-get install apache2-utils
    – adrian7
    Feb 27, 2015 at 17:46
  • On Arch -- pacman -S apr-util
    – bobah
    Oct 27, 2018 at 9:56
70

On my CentOS 6.2, this worked:

sudo yum install httpd-tools
4
  • Worked on my Fedora 17 as well! Thanks! :-)
    – John
    Nov 3, 2012 at 16:08
  • Works on CentOS 6
    – WoooHaaaa
    Apr 24, 2014 at 5:43
  • Works on RHEL 6.6
    – codehead
    Apr 17, 2015 at 21:10
  • Centos 7 working like charm
    – OAH
    Jul 29, 2020 at 15:21
1

This should help you. It depends upon on Apache Portable Runtime library and APR-util library

http://code.google.com/p/apachebench-standalone/wiki/HowToBuild

1
  • I actually tried that before I posted the answer, but hasn't been updated and it's not compatible with late versions of APR - No matter what, I couldn't get it to compile.
    – arnorhs
    Feb 28, 2011 at 11:08
1

For those who came here looking for Apache Benchmark (ab) binary, you should know that ab can be slow sometimes (testing nginx for example). Also, it requires apr-util to be installed (with sudo), and there is no standalone binary to download.

Instead, I'd recommend an alternative - wrk - it is faster and requires no dependencies:

https://github.com/wg/wrk

(Or the GO variant: https://github.com/tsliwowicz/go-wrk )

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .