Apache服务

1.web服务概述
   WebService,顾名思义就是基于Web的服务。它使用HTTP方式,接收和响应外部系统的     某种请求。从 而实现远程调用.

2.Apache安装配置

[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# netstat -pltun|grep httpd  #Apache默认是80端口 
tcp6       0      0 :::80                   :::*                    LISTEN      2245/httpd          
[root@localhost ~]# 
文件/目录                         对应的功能
/var/log/httpd/access.log        访问日志
/var/log/httpd/error_log         错误日志
/var/www/html/                   站点目录
/usr/lib64/httpd/modules/        模块文件路径
/etc/httpd/conf/httpd.conf       主配置文件
/etc/httpd/conf.d/*.conf         辅助配置文件
#httpd启动后,通过浏览器访问:http://192.168.72.151

3.文本方式访问

[root@localhost ~]# yum -y install elinks
[root@localhost ~]# elinks httpd://192.168.72.151

 4.ab命令压测

[root@localhost ~]# ab -c500 -n 1000 http://192.168.72.151/  #-c是并发 -n是访问 一般就用这俩参数
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.72.151 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.6
Server Hostname:        192.168.72.151
Server Port:            80

Document Path:          /
Document Length:        13 bytes

Concurrency Level:      500
Time taken for tests:   0.720 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      272000 bytes
HTML transferred:       13000 bytes
Requests per second:    1388.49 [#/sec] (mean)
Time per request:       360.103 [ms] (mean)
Time per request:       0.720 [ms] (mean, across all concurrent requests)
Transfer rate:          368.82 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    3   3.6      0      10
Processing:     2  119 214.3     20     708
Waiting:        1  119 214.3     20     708
Total:          9  122 216.7     20     716

Percentage of the requests served within a certain time (ms)
  50%     20
  66%     20
  75%     33
  80%    215
  90%    706
  95%    710
  98%    713
  99%    715
 100%    716 (longest request)
[root@localhost ~]# 

 下一章节:什么是虚拟主机

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值