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 ~]#
下一章节:什么是虚拟主机