如何在CentOS上安装Apache Benchmark?


30

我尝试使用以下方法安装Apache Benchmark:是否可以在不安装apache解决方案的情况下在我的centos上安装Apache Bench(ab),但是当我运行时yumdownloader httpd,出现错误:

root@local [~/httpd]# yumdownloader httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: yum.phx.singlehop.com
 * elrepo: repos.lax-noc.com
 * extras: centos.tcpdiag.net
 * updates: mirror.stanford.edu
No Match for argument httpd
Nothing to download

它是什么?我该如何解决?

编辑1:我尝试使用迈克尔·汉普顿的方式,但我得到此错误:

root@local [~]# yum provides /usr/bin/ab
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: yum.phx.singlehop.com
 * elrepo: repos.lax-noc.com
 * extras: centos.tcpdiag.net
 * updates: mirror.stanford.edu
No Matches found

root@local [~]# yum install httpd-tools
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: yum.phx.singlehop.com
 * elrepo: repos.lax-noc.com
 * extras: centos.tcpdiag.net
 * updates: mirror.stanford.edu
Setting up Install Process
No package httpd-tools available.
Error: Nothing to do

Answers:


72

您可以使用以下命令找到包含所需程序的软件包yum provides

yum provides /usr/bin/ab

然后,您将看到它abhttpd-tools包装中。

现在您可以安装它:

yum install httpd-tools

大量的答案,但我再次出错..请检查Edit 1
Mehdi

2
您排除了某些软件包,否则以其他方式破坏了yum配置。检查目录中的/etc/yum.conf和文件/etc/yum.repos.d是否有不适当的排除项。
迈克尔·汉普顿

大量使用tanx,用于/etc/yum.conf,但不包括httpd:D
Mehdi

7
你也可以运行sudo yum install /usr/bin/ab
KingPong

1
@KingPong解决方案成功了。
试用
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.