Apache Ab安装

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值