Apache优化之日志分割

Apache优化之日志分割

实验环境

centos7虚拟机一台

win10主机一台

日志分割的原因

1.日志文件占用磁盘空间很大

2.查看相关信息不方便

日志分割的工具

1.Apache自带rotatelogs分割工具实现

2.第三方工具cronolog分割

日志分割工具的用法

1.rotatelogs分割工具

1.查看是否安装Apache

[root@localhost ~]# rpm -q httpd
未安装软件包 httpd 

2.安装一下Apache并查看

[root@localhost ~]# yum -y install httpd
[root@localhost ~]# rpm -q httpd
httpd-2.4.6-90.el7.centos.x86_64

3.rotatelogs是Apache里面自带的,我们查看有没有rotatelogs这个工具

[root@localhost ~]# which rotatelogs
/usr/sbin/rotatelogs

4.查看一下Apache日志目录下面是否有日志

[root@localhost ~]# cd /var/log/httpd/
[root@localhost httpd]# ls
[root@localhost httpd]# 

5.对Apache主配置文件进行配置

[root@localhost httpd]# vim /etc/httpd/conf/httpd.conf
Listen 192.168.73.132:80
#Listen 80
ServerName www.hello.com:80

6.关闭防火墙,启动服务

[root@localhost httpd]# systemctl stop firewalld
[root@localhost httpd]# setenforce 0
[root@localhost httpd]# systemctl start httpd

7.查看Apache日志文件

[root@localhost httpd]# ls /var/log/httpd/
access_log  error_log

由此可见,产生Apache日志文件是在httpd服务启动之后

8.查看access_log文件和error_log文件

[root@localhost httpd]# cat access_log 
[root@localhost httpd]# cat error_log 
[Mon Dec 16 14:28:13.769771 2019] [core:notice] [pid 2188] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Dec 16 14:28:13.770847 2019] [suexec:notice] [pid 2188] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 16 14:28:13.783634 2019] [lbmethod_heartbeat:notice] [pid 2188] AH02282: No slotmem from mod_heartmonitor
[Mon Dec 16 14:28:13.786219 2019] [mpm_prefork:notice] [pid 2188] AH00163: Apache/2.4.6 (CentOS) configured -- resuming normal operations
[Mon Dec 16 14:28:13.786253 2019] [core:notice] [pid 2188] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

9.在win10主机的浏览器里面输入IP地

Apache优化之日志分割_第1张图片

10.查看access_log文件

[root@localhost httpd]# cat error_log 
[Mon Dec 16 14:28:13.769771 2019] [core:notice] [pid 2188] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Dec 16 14:28:13.770847 2019] [suexec:notice] [pid 2188] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 16 14:28:13.783634 2019] [lbmethod_heartbeat:notice] [pid 2188] AH02282: No slotmem from mod_heartmonitor
[Mon Dec 16 14:28:13.786219 2019] [mpm_prefork:notice] [pid 2188] AH00163: Apache/2.4.6 (CentOS) configured -- resuming normal operations
[Mon Dec 16 14:28:13.786253 2019] [core:notice] [pid 2188] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[root@localhost httpd]# cat access_log 
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET / HTTP/1.1" 403 4897 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/bootstrap.min.css HTTP/1.1" 200 19341 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/open-sans.css HTTP/1.1" 200 5081 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /images/apache_pb.gif HTTP/1.1" 200 2326 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /images/poweredby.png HTTP/1.1" 200 3956 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Light/OpenSans-Light.woff HTTP/1.1" 404 241 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/LightItalic/OpenSans-LightItalic.woff HTTP/1.1" 404 253 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Regular/OpenSans-Regular.woff HTTP/1.1" 404 245 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Italic/OpenSans-Italic.woff HTTP/1.1" 404 243 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Semibold/OpenSans-Semibold.woff HTTP/1.1" 404 247 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.woff HTTP/1.1" 404 259 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Bold/OpenSans-Bold.woff HTTP/1.1" 404 239 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.woff HTTP/1.1" 404 251 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.woff HTTP/1.1" 404 249 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.woff HTTP/1.1" 404 261 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Light/OpenSans-Light.ttf HTTP/1.1" 404 240 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Regular/OpenSans-Regular.ttf HTTP/1.1" 404 244 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/LightItalic/OpenSans-LightItalic.ttf HTTP/1.1" 404 252 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Italic/OpenSans-Italic.ttf HTTP/1.1" 404 242 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.ttf HTTP/1.1" 404 258 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Semibold/OpenSans-Semibold.ttf HTTP/1.1" 404 246 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/Bold/OpenSans-Bold.ttf HTTP/1.1" 404 238 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.ttf HTTP/1.1" 404 250 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.ttf HTTP/1.1" 404 248 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:14:51:16 +0800] "GET /noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf HTTP/1.1" 404 260 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.132 - - [16/Dec/2019:14:51:24 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"
192.168.73.132 - - [16/Dec/2019:14:51:25 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"

由此可见,在win10主机中访问过Apache服务后就会产生这么多繁杂的信息。可想而知,当日志不进行分割的时候,日志文件就会越来越大,信息更加繁杂,查询起来不会方便,所以,我们需要对日志文件进行分割。

11.修改Apache主配置文件

[root@localhost httpd]# cd /etc/httpd/
[root@localhost httpd]# ls
conf  conf.d  conf.modules.d  logs  modules  run
[root@localhost httpd]# ll
总用量 0
drwxr-xr-x. 2 root root  37 12月 16 14:26 conf
drwxr-xr-x. 2 root root  82 12月 16 14:11 conf.d
drwxr-xr-x. 2 root root 146 12月 16 14:11 conf.modules.d
lrwxrwxrwx. 1 root root  19 12月 16 14:11 logs -> ../../var/log/httpd
lrwxrwxrwx. 1 root root  29 12月 16 14:11 modules -> ../../usr/lib64/httpd/modules
lrwxrwxrwx. 1 root root  10 12月 16 14:11 run -> /run/httpd
[root@localhost httpd]# cd conf
[root@localhost conf]# ls
httpd.conf  magic
[root@localhost conf]# vim httpd.conf 
    CustomLog "| /usr/sbin/rotatelogs -l logs/www.hello.com_access_%Y%m%dlog 86400" combined
ErrorLog "| /usr/sbin/rotatelogs -l logs/www.hello.com.error_%Y%m%dlog 86400"

12.先关闭httpd服务,再启动httpd服务

[root@localhost conf]# systemctl stop httpd
[root@localhost conf]# systemctl start httpd

13.去看一下Apache日志文件下面是否产生了日志文件

[root@localhost conf]# cd /var/log/httpd/
[root@localhost httpd]# ls
access_log  error_log  www.hello.com.error_20191216log
[root@localhost httpd]# date 
2019年 12月 16日 星期一 15:17:43 CST
[root@localhost httpd]# date -s 12/17/19
2019年 12月 17日 星期二 00:00:00 CST
[root@localhost httpd]# systemctl stop httpd
[root@localhost httpd]# systemctl start httpd
[root@localhost httpd]# ls
access_log  error_log  www.hello.com.error_20191216log  www.hello.com.error_20191217log

2.cronolog分割工具

1.下载httpd服务,并安装cronolog分割工具

[root@localhost ~]# yum -y install httpd
[root@localhost ~]# ls
anaconda-ks.cfg                   initial-setup-ks.cfg  模板  图片  下载  桌面
cronolog-1.6.2-14.el7.x86_64.rpm  公共                  视频  文档  音乐
[root@localhost ~]# rpm -ivh cronolog-1.6.2-14.el7.x86_64.rpm 
警告:cronolog-1.6.2-14.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:cronolog-1.6.2-14.el7            ################################# [100%]

2.查看cronlog所在的文件目录

[root@localhost ~]# which cronolog 
/usr/sbin/cronolog

3.修改Apache的主配置文件

[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
ServerName www.hello.com:80
Listen 192.168.73.132:80
#Listen 80
ErrorLog "| /usr/sbin/cronolog -l logs/www.hello.com.error_%Y%m%dlog"
    CustomLog "| /usr/sbin/cronolog -l logs/www.hello.com.access_%Ym%dlog" combined

4.重启服务,并查看Apache的日志文件

[root@localhost httpd]# systemctl stop httpd
[root@localhost httpd]# systemctl start httpd
[root@localhost httpd]# ls
www.hello.com.error_20191216log
[root@localhost httpd]# cat www.hello.com.error_20191216log 
[Mon Dec 16 15:57:20.630003 2019] [core:notice] [pid 2734] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Dec 16 15:57:20.631047 2019] [suexec:notice] [pid 2734] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 16 15:57:20.696737 2019] [lbmethod_heartbeat:notice] [pid 2734] AH02282: No slotmem from mod_heartmonitor
[Mon Dec 16 15:57:20.700535 2019] [mpm_prefork:notice] [pid 2734] AH00163: Apache/2.4.6 (CentOS) configured -- resuming normal operations
[Mon Dec 16 15:57:20.700580 2019] [core:notice] [pid 2734] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

5.关闭服务器的防火墙,在win10主机里面输入IP地址查看,再查看一下日志文件

[root@localhost httpd]# systemctl stop firewalld
[root@localhost httpd]# setenforce 0

Apache优化之日志分割_第2张图片

[root@localhost httpd]# ls
www.hello.com.access_2019m16log  www.hello.com.error_20191216log
[root@localhost httpd]# cat www.hello.com.access_2019m16log
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET / HTTP/1.1" 403 4897 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/Light/OpenSans-Light.woff HTTP/1.1" 404 241 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/LightItalic/OpenSans-LightItalic.woff HTTP/1.1" 404 253 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/Regular/OpenSans-Regular.woff HTTP/1.1" 404 245 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/Italic/OpenSans-Italic.woff HTTP/1.1" 404 243 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/Semibold/OpenSans-Semibold.woff HTTP/1.1" 404 247 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.woff HTTP/1.1" 404 259 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/Bold/OpenSans-Bold.woff HTTP/1.1" 404 239 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.woff HTTP/1.1" 404 251 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.woff HTTP/1.1" 404 249 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:38 +0800] "GET /noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.woff HTTP/1.1" 404 261 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/LightItalic/OpenSans-LightItalic.ttf HTTP/1.1" 404 252 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/Light/OpenSans-Light.ttf HTTP/1.1" 404 240 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/Regular/OpenSans-Regular.ttf HTTP/1.1" 404 244 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/Italic/OpenSans-Italic.ttf HTTP/1.1" 404 242 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/Bold/OpenSans-Bold.ttf HTTP/1.1" 404 238 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.ttf HTTP/1.1" 404 250 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/Semibold/OpenSans-Semibold.ttf HTTP/1.1" 404 246 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.ttf HTTP/1.1" 404 258 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf HTTP/1.1" 404 260 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.150 - - [16/Dec/2019:16:04:39 +0800] "GET /noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.ttf HTTP/1.1" 404 248 "http://192.168.73.132/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
192.168.73.132 - - [16/Dec/2019:16:04:46 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"
192.168.73.132 - - [16/Dec/2019:16:04:47 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"

6.修改日期,查看Apache服务的日志文件

[root@localhost httpd]# date -s 12/17/19
2019年 12月 17日 星期二 00:00:00 CST
[root@localhost httpd]# systemctl stop httpd
[root@localhost httpd]# systemctl start httpd
[root@localhost httpd]# ls
www.hello.com.access_2019m16log  www.hello.com.error_20191216log  www.hello.com.error_20191217log

你可能感兴趣的:(云计算架构)