Mac系統(tǒng)上安裝AB工具
一蛔琅、官網(wǎng)下載 Apache HTPP Server
http://httpd.apache.org/download.cgi#apache24
截圖.png
二狭魂、安裝工具
- 安裝 apr
終端
執(zhí)行brew install apr
打印如下信息:
apr is keg-only, which means it was not symlinked into /usr/local,
because Apple's CLT package contains apr.
If you need to have apr first in your PATH run:
echo 'export PATH="/usr/local/opt/apr/bin:$PATH"' >> ~/.bash_profile
==> Summary
?? /usr/local/Cellar/apr/1.7.0: 59 files, 1.4MB
注意提示:If you need to have apr first in your PATH run: echo 'export PATH="/usr/local/opt/apr/bin:$PATH"' >> ~/.bash_profile
所以我們到再執(zhí)行下 echo 'export PATH="/usr/local/opt/apr/bin:$PATH"' >> ~/.bash_profile
- 安裝 apr-util
終端
執(zhí)行brew install apr-util
打印如下信息洽损,同樣注意提示:If you need to have apr-util first in your PATH run: echo 'export PATH="/usr/local/opt/apr-util/bin:$PATH"' >> ~/.bash_profile
于是我們?cè)賵?zhí)行 echo 'export PATH="/usr/local/opt/apr-util/bin:$PATH"' >> ~/.bash_profile
- 安裝 pcre
終端
執(zhí)行brew install pcre
最后執(zhí)行 source ~/.bash
安裝 httpd
進(jìn)入 httpd-2.4.39 目錄
依次執(zhí)行命令:
./configure
sudo make
sudo make install
安裝成功树灶,我們測(cè)試下工具督笆。執(zhí)行 ab -n 1 -c 1 http://www.baidu.com/
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.baidu.com (be patient).....done
Server Software: BWS/1.1
Server Hostname: www.baidu.com
Server Port: 80
Document Path: /
Document Length: 153651 bytes
Concurrency Level: 1
Time taken for tests: 0.826 seconds
Complete requests: 1
Failed requests: 0
Total transferred: 154625 bytes
HTML transferred: 153651 bytes
Requests per second: 1.21 [#/sec] (mean)
Time per request: 825.589 [ms] (mean)
Time per request: 825.589 [ms] (mean, across all concurrent requests)
Transfer rate: 182.90 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 23 23 0.0 23 23
Processing: 803 803 0.0 803 803
Waiting: 56 56 0.0 56 56
Total: 826 826 0.0 826 826
安裝成功~