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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

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

3 k* r. W* N& z/ b

打开httpd.conf # O$ k+ p% u7 ^# M& n- }( w& k
找到 CustomLog logs/access_log combined這一行

在前一行加入

SetEnvIf User-Agent "(internal dummy connection)" dontlog
  • 1
    1 ^0 ]2 d* @' W$ i. ?! w

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

CustomLog logs/access_log combined env=!dontlog[root@controller httpd]# vim /etc/httpd/conf/httpd.conf 1 N9 G% P- [5 z' z) ^; Y4 x1 V
    #
4 O' n7 [: K! D8 U    # The location and format of the access logfile (Common Logfile Format).
! q" C; W' D# Y    # If you do not define any access logfiles within a <VirtualHost>1 [( Z  m, o1 R( Q
    # container, they will be logged here.  Contrariwise, if you *do*
( ^5 @. Z5 O" j0 C2 ]; b5 U, D% \    # define per-<VirtualHost> access logfiles, transactions will be
( q' o: o1 q) P' {    # logged therein and *not* in this file.
" `# j; J0 @9 o' t, ]    #
8 m, _) N- }  S' s7 |$ g    #CustomLog "logs/access_log" common5 u8 E+ d: c% U7 E4 o4 W; t6 D
    #, C: x7 Z& ?( g1 q; ^6 {' ^
    # If you prefer a logfile with access, agent, and referer information
% h& {6 Y+ J4 t    # (Combined Logfile Format) you can use the following directive.( m, R1 H' d; f7 j' u# E
    #
$ O7 @3 f6 c) y1 u3 R! B# w6 d" A    SetEnvIf User-Agent "(internal dummy connection)" dontlog
: O; Y. _* d0 G! }) g8 w: B    CustomLog "logs/access_log" combined env=!dontlog

' E- r; c. _$ I' N/ a0 N2 t</IfModule>
: @6 t/ K. y. G* i<IfModule alias_module>
& \5 ~. k. I: y$ ^
, l% h& d& Z5 S, I重启apache (systemctl restart httpd.service) 生效
+ ?6 @3 h: N- E! |0 }& z
# h9 k: s- v' w. {

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2018-9-2 14:12:14 | 显示全部楼层
cat /etc/httpd/conf.d/wsgi-keystone.conf & ]1 O# Y8 C: ^$ M. h2 m7 B
Listen controller:5000
% `0 U/ G0 t8 w% |3 v8 |Listen controller:35357
+ C, o3 x/ n* W! A  m
' }, y) M9 s& _# ?<VirtualHost *:5000>
& x" N, V9 t" y    WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
% d* B7 q. k: `1 Y. d    WSGIProcessGroup keystone-public
% W) u5 g! Q/ ^: i: i; ]    WSGIScriptAlias / /usr/bin/keystone-wsgi-public; ~/ E3 w' a. h, M- G/ T' ?2 I
    WSGIApplicationGroup %{GLOBAL}$ g7 k* t  K+ A0 t4 L
    WSGIPassAuthorization On5 M/ U# ~$ G5 }7 A
    LimitRequestBody 114688/ d. Y* F: R" |
    <IfVersion >= 2.4>: }  k) [# h7 w( [6 o- H; ?
      ErrorLogFormat "%{cu}t %M"" u2 E$ D) [; l) m: Z* w2 x
    </IfVersion>- g' Y9 c( Q" q
    ErrorLog /var/log/httpd/keystone.log" M( O% U& Y( Z- q
    SetEnvIf User-Agent "(internal dummy connection)" dontlog
7 i3 {/ m. }( _/ Y! [- y    CustomLog /var/log/httpd/keystone_access.log combined env=!dontlog! Z6 i; K2 ?# Q
- S, c5 @- c! g7 @7 n
    <Directory /usr/bin>
8 I& `5 j! y! J! v6 L7 G        <IfVersion >= 2.4>' A1 U7 X! u" P) C0 d3 B& ?
            Require all granted
: j" j1 t$ ~! U5 P2 v& {        </IfVersion>* s9 C# ~3 b, Z. k9 D' h) U
        <IfVersion < 2.4>- z& ?5 v( ~  U" B' c: g2 m3 t
            Order allow,deny
: E- U1 Y$ J9 |1 z5 S: a2 Q5 M) j            Allow from all$ E  x! w! t/ n* {. [. O
        </IfVersion>
8 S- B) t' S5 J& Q    </Directory>
/ G9 p3 V5 G# s</VirtualHost>
2 b/ @  m0 @  ~3 m+ Z6 E: K7 O2 F
& X: i- J# Q9 l3 u<VirtualHost *:35357>% G1 `6 _& I0 J
    WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}# z& V! G9 z) P, o
    WSGIProcessGroup keystone-admin
1 l5 L2 ~1 X. f/ g, }3 r    WSGIScriptAlias / /usr/bin/keystone-wsgi-admin* ^, M% q" B: x% n& ^
    WSGIApplicationGroup %{GLOBAL}; S3 [5 ^/ p* [$ j* S4 J
    WSGIPassAuthorization On
; o5 c6 F! ~$ @% T; q7 s2 ]    LimitRequestBody 114688- _0 ?) s: E' o2 o+ ]
    <IfVersion >= 2.4>
& D) P% _/ T# Y  B: h, i      ErrorLogFormat "%{cu}t %M"( f: I- S9 Z5 L- @! z  x: a/ I$ @
    </IfVersion>1 I3 ^! X$ Q, W0 B
    ErrorLog /var/log/httpd/keystone.log   ]! Q& }% U8 z4 I+ L
     SetEnvIf User-Agent "(internal dummy connection)" dontlog
- a# D9 n: L2 o9 a( c    CustomLog /var/log/httpd/keystone_access.log combined env=!dontlog
9 Z) x8 c  j& y8 ^2 y3 P! @; x2 _/ q/ z! F6 _
    <Directory /usr/bin>" \* l$ D: h, X1 |- V% J2 A/ B
        <IfVersion >= 2.4>) m6 ]( Z- w' L: S
            Require all granted- @. i3 T7 S: a% Y5 G
        </IfVersion>  C' Q1 S6 @9 A3 p1 t9 `
        <IfVersion < 2.4>: Z4 v. g4 r0 R. i) B1 N  ]+ B, h
            Order allow,deny% z' f0 z! f& k& ]' s
            Allow from all& k  u; h. S. A4 W) V
        </IfVersion>
& R7 V& `7 s6 s3 `+ a2 q    </Directory>
3 J! H+ Q5 z% m7 r</VirtualHost>
* m& b6 {0 Y' Q, q  P( g$ p! T& J6 M
Alias /identity /usr/bin/keystone-wsgi-public1 f' h/ Q% O2 h# K6 U/ U2 j
<Location /identity>; x! K* y; W' K9 T$ v! u( I
    SetHandler wsgi-script
- H+ O+ Z7 i$ l0 U! i    Options +ExecCGI" g" Y: y4 Y) h* K# {

) k5 Y  K, A% K& [% w; R    WSGIProcessGroup keystone-public
2 z# I( Y9 F7 N9 e; A  H    WSGIApplicationGroup %{GLOBAL}
' p# A& l& [3 Z+ r: i! {    WSGIPassAuthorization On
$ b' S1 @* D! ~# P</Location>
; a5 |& e( l( p( j$ f- G4 [5 D% B6 g  g+ I* Q, w8 g. C, y
Alias /identity_admin /usr/bin/keystone-wsgi-admin/ s  q! Q& R& s" ]/ K* @+ @- X
<Location /identity_admin>
3 l6 @& A( Z2 a0 `, m3 ^3 Y2 j    SetHandler wsgi-script* I' R2 _# b" g
    Options +ExecCGI
  V: {9 }/ @" R. g- W& K+ u* T3 ~, ]; N
    WSGIProcessGroup keystone-admin; P+ Z6 l0 e" f* }& {" ]
    WSGIApplicationGroup %{GLOBAL}
1 t& {1 j1 Y' ?, x$ s# v    WSGIPassAuthorization On
- e, v# I- [  z- `8 ?</Location>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 04:23 , Processed in 0.017090 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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