找回密码
 注册
查看: 4651|回复: 1

解决Apache日志"internal dummy connection"方法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-9-2 13:59:09 | 显示全部楼层 |阅读模式

  m" Y$ N  h' ~( P

打开httpd.conf
) D4 y- s) T. O* v找到 CustomLog logs/access_log combined這一行

在前一行加入

SetEnvIf User-Agent "(internal dummy connection)" dontlog
  • 1
    2 j% N3 }' j8 }6 \" e6 @. E9 l

然后改写CustomLog logs 這一行,改成下面這樣(在后面加上 env=!dontlog)

CustomLog logs/access_log combined env=!dontlog[root@controller httpd]# vim /etc/httpd/conf/httpd.conf 0 J7 M0 D7 I1 U0 Z# r
    #
( Q7 S- V7 I2 f% [    # The location and format of the access logfile (Common Logfile Format).
6 y1 A+ j- T7 H, k    # If you do not define any access logfiles within a <VirtualHost>
8 ?( Y( I0 n. A! @7 T6 u8 H    # container, they will be logged here.  Contrariwise, if you *do*  T3 l& T! H  F
    # define per-<VirtualHost> access logfiles, transactions will be9 w3 k: t" u+ X
    # logged therein and *not* in this file." o* |6 \( d) P8 A$ R& `7 H/ ], g5 I
    #1 \% x/ V2 F$ h$ k
    #CustomLog "logs/access_log" common7 `& n* {; \# Y  ^5 ?1 o; I
    #
0 \$ S4 {, f$ P+ H. P- D! N    # If you prefer a logfile with access, agent, and referer information; |' O7 a- r4 i9 D; M9 A' z
    # (Combined Logfile Format) you can use the following directive.
8 p+ u0 j5 R  z# y- F1 `1 c    #
, Q  ?- j3 [2 [9 M; A: v1 \% f/ O    SetEnvIf User-Agent "(internal dummy connection)" dontlog; u, l( a* V* \5 Q  Q8 L/ m9 p8 n- f
    CustomLog "logs/access_log" combined env=!dontlog

5 ?( `# K) _! r4 G& u& W</IfModule>
1 ^/ [- M8 E$ K  A8 h& e5 V<IfModule alias_module>$ s2 x" Y% C. c; Q. O  G

- T+ l; K9 K  a* O* B( `# _9 F重启apache (systemctl restart httpd.service) 生效
$ \, D' X2 W% d' N, Q2 W
. ~# X5 U& E6 f  C9 F4 L5 ]3 j& G

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2018-9-2 14:12:14 | 显示全部楼层
cat /etc/httpd/conf.d/wsgi-keystone.conf 4 P" T! ]; c: A$ V- S
Listen controller:5000
+ [: K$ Z  q" yListen controller:35357
/ C! B5 W2 o) v$ M# [% o6 H  g" n/ A( V
<VirtualHost *:5000>% @& l; r- x2 c) z5 i# \* C% t
    WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
, z  M" L1 b, L7 Q, L, w    WSGIProcessGroup keystone-public
4 J( h* h* w9 k8 q    WSGIScriptAlias / /usr/bin/keystone-wsgi-public
% i( ~# b( h, t    WSGIApplicationGroup %{GLOBAL}
7 c  S  q0 N; a- G    WSGIPassAuthorization On
% Q, ?/ K4 r/ _# C    LimitRequestBody 114688
# k& @) Z2 f+ ]5 }9 m    <IfVersion >= 2.4>5 @2 q+ p' f1 ~- r
      ErrorLogFormat "%{cu}t %M"
% h) k8 r, v( M& L# B( H. b8 c    </IfVersion>
# i; D0 j6 J$ p! B1 g    ErrorLog /var/log/httpd/keystone.log! f$ E2 @0 b" G7 j
    SetEnvIf User-Agent "(internal dummy connection)" dontlog
# s9 _9 c: J  I' Y    CustomLog /var/log/httpd/keystone_access.log combined env=!dontlog3 C, L1 k# m# ?1 @% Y$ h2 {3 b

9 a' ^7 w: J, l& X    <Directory /usr/bin>
7 u) O6 }. [6 P% `; I        <IfVersion >= 2.4>
/ b& ?/ `) m$ U+ }            Require all granted
8 q7 @- ^% o2 n1 _3 e, u' ^        </IfVersion>
6 p' J5 m: g; A3 f# w        <IfVersion < 2.4>
: l" i5 ^" \# @" ~) A            Order allow,deny2 r$ D, t, @$ E, y: n$ F
            Allow from all! j3 _9 o8 c% C3 K8 T$ H1 Y; x9 \* l7 x
        </IfVersion>; N  J* R6 z. H! P9 P- ?
    </Directory>
8 N* V0 n- \+ K: L1 N2 A$ h; ~. H</VirtualHost>
# P" M  n3 J5 q& E" Z/ k- B9 j8 _% C4 L8 i
<VirtualHost *:35357>
! b5 v7 J6 Q- u! }6 X" E; @    WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
, f. t. t, e8 T: }7 p    WSGIProcessGroup keystone-admin
) s4 D; b8 ?; n    WSGIScriptAlias / /usr/bin/keystone-wsgi-admin4 C: X) P$ Y$ ]) m; |
    WSGIApplicationGroup %{GLOBAL}8 `0 r1 S  a1 V" Y0 _% \
    WSGIPassAuthorization On9 _4 Q  G: U9 y1 T
    LimitRequestBody 114688" E! |2 V  Q7 ]
    <IfVersion >= 2.4>
9 @/ x! n/ W6 j& J* y$ a      ErrorLogFormat "%{cu}t %M"8 ?5 A$ Y3 x0 H# k2 B5 d
    </IfVersion>
6 m& m' Y7 j2 N' O    ErrorLog /var/log/httpd/keystone.log % k, ~" M( B+ R
     SetEnvIf User-Agent "(internal dummy connection)" dontlog
+ o' L$ ?  A! Z    CustomLog /var/log/httpd/keystone_access.log combined env=!dontlog/ m% ^: C' X% M+ I* p0 f: w8 y

( P3 \0 M4 }6 B4 f+ f% \% `; u    <Directory /usr/bin>
! @/ q+ @; K% t; ?6 u7 m* b: f" l        <IfVersion >= 2.4>
1 a% j7 I, o; K* j. y9 _: F8 t            Require all granted
: }$ F: g8 A8 G& p1 f        </IfVersion>, z1 W* B& z( Y
        <IfVersion < 2.4>
6 B: z4 N8 [, Y            Order allow,deny
" ^& F$ L" h5 m( C0 _- Y            Allow from all
( `+ h( \5 P% P5 o        </IfVersion>
# }7 ]8 C% V: _3 b% ~6 d    </Directory>( v9 A1 L6 P8 q' V1 M
</VirtualHost>
* q- M' Q) J% v- E
: K5 v( g8 A- D; \6 }; y  cAlias /identity /usr/bin/keystone-wsgi-public& C8 ]2 |# `# M5 X
<Location /identity>
7 I+ v6 \6 D( t0 p' {6 B    SetHandler wsgi-script; e0 z( j5 d3 y% R5 d9 P. [) P3 l
    Options +ExecCGI7 C# M1 ?; ?8 @( i
% J+ L0 ?: R4 R# e5 }) v
    WSGIProcessGroup keystone-public
6 f( z& A# i# A; v    WSGIApplicationGroup %{GLOBAL}  n$ J1 ]' [1 X, r4 G
    WSGIPassAuthorization On/ H% A3 S: D# C7 w, S
</Location>
% A) |6 s/ r  h  ]8 q% U' q6 t3 ~! \) F) v( M
Alias /identity_admin /usr/bin/keystone-wsgi-admin
3 ~7 W! j- j8 n<Location /identity_admin>! u) B/ V9 T( Q9 f
    SetHandler wsgi-script
- G: t) T. \0 ], Y    Options +ExecCGI
* e, q8 N( n' U  _2 s! I
" r! N: }& e$ w    WSGIProcessGroup keystone-admin
9 Q* q( |9 y5 |% |9 z    WSGIApplicationGroup %{GLOBAL}
: Z/ l& Y' T( R2 y# u# |' l    WSGIPassAuthorization On8 ]+ @9 {+ X% Z- t* K
</Location>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 03:26 , Processed in 0.017575 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表