马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
' a1 L A* u* H" Y" a
打开httpd.conf 9 W- i! |$ T+ M9 N8 B$ J' z, A) a
找到 CustomLog logs/access_log combined這一行 在前一行加入 SetEnvIf User-Agent "(internal dummy connection)" dontlog- 1$ m, ^$ ?2 b, t9 \: M2 U# Z7 W
然后改写CustomLog logs 這一行,改成下面這樣(在后面加上 env=!dontlog) CustomLog logs/access_log combined env=!dontlog[root@controller httpd]# vim /etc/httpd/conf/httpd.conf
% o! Y" H& \" S' p #
- O: P* P* O5 @) ^ # The location and format of the access logfile (Common Logfile Format).4 q- |4 k d1 m, P% O* I
# If you do not define any access logfiles within a <VirtualHost>& O8 a; z3 `+ ~6 e
# container, they will be logged here. Contrariwise, if you *do*
/ \' T6 [* y; E- n, P# k6 D- J; m # define per-<VirtualHost> access logfiles, transactions will be
2 D" ~! S1 t0 K0 w+ { K3 L0 v # logged therein and *not* in this file.
2 e0 R% P/ \# m5 G/ Y! s #/ v6 E$ j( G K/ Q" O5 Z
#CustomLog "logs/access_log" common' L% _1 H; \$ u# B% T* `! O5 D
#
4 Q g; R, X7 @1 Q( J/ X& p1 I+ h4 z) U$ M # If you prefer a logfile with access, agent, and referer information: F, u- ]$ C0 i. s% X7 J2 o
# (Combined Logfile Format) you can use the following directive.: K1 ~6 Y7 L* a# Q5 X
#
! g9 q$ C* {2 G& u( n SetEnvIf User-Agent "(internal dummy connection)" dontlog/ E4 [( H9 I5 v" M5 P
CustomLog "logs/access_log" combined env=!dontlog- s' b4 P" `5 ^7 \$ D% b" m
</IfModule>
! Z( N8 G. b1 E+ G) U ?! Y" e# p<IfModule alias_module>+ K# A/ ]6 H# @. q
# `$ ^! ~( P" X) O/ I \# f! g6 J重启apache (systemctl restart httpd.service) 生效
% G1 f( j' v6 ]! j% X+ [: V- d0 n9 w) R" t/ s
|