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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-9-2 13:59:09 | 显示全部楼层 |阅读模式
1 X- `% s3 f. m3 `

打开httpd.conf " l3 @' s6 S: M, J
找到 CustomLog logs/access_log combined這一行

在前一行加入

SetEnvIf User-Agent "(internal dummy connection)" dontlog
  • 1
    # Z  \9 |  T& [/ |# {# \

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

CustomLog logs/access_log combined env=!dontlog[root@controller httpd]# vim /etc/httpd/conf/httpd.conf
" N: W' h; Y* R9 S; B& V- \    #
8 b, j; X: m* T( X! f2 k' f" {    # The location and format of the access logfile (Common Logfile Format).; U8 q( U  Y) i/ ~/ l" c
    # If you do not define any access logfiles within a <VirtualHost>1 w1 X" X, w8 ^+ M5 D* L% o
    # container, they will be logged here.  Contrariwise, if you *do*0 n7 P. r5 O+ c8 A) h
    # define per-<VirtualHost> access logfiles, transactions will be( _, k& ?1 _3 y9 y" ^* \9 n; C
    # logged therein and *not* in this file.
7 \, T; Z% {3 P! V( ?. q    #! k" N4 u0 w7 G  X. k6 J( A
    #CustomLog "logs/access_log" common
9 b% ^" R/ H  J2 H4 k    #( y0 M$ v5 `5 \; ^7 O5 m
    # If you prefer a logfile with access, agent, and referer information3 I- G  p& g# \
    # (Combined Logfile Format) you can use the following directive.) P9 O% T0 @/ L$ M( ~( y0 _
    #
: H5 s: V1 `0 d% Q, w    SetEnvIf User-Agent "(internal dummy connection)" dontlog
8 ~9 l3 Y+ C. X7 k    CustomLog "logs/access_log" combined env=!dontlog
3 y. W7 l7 [. m" z3 `4 {
</IfModule>% t& k& M/ W- C& S) _
<IfModule alias_module>0 ?5 R. F0 |! b" f" d" s. L5 u

: ]# O3 c. S6 S. [7 c- k( i9 C重启apache (systemctl restart httpd.service) 生效" Q5 s" c* x% ^) _+ s5 @, i
- T8 N, |" b. T+ h

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2018-9-2 14:12:14 | 显示全部楼层
cat /etc/httpd/conf.d/wsgi-keystone.conf
# H9 @3 A( F9 m- WListen controller:5000
$ x2 A3 a" Y7 |3 D! J- |Listen controller:353571 g1 ?* U" J* E0 ]2 p3 J% ^- T

, I5 O- _9 N) e$ S; d: n2 P<VirtualHost *:5000>  s  \5 y) F6 j
    WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}+ \% |' u2 a. x( a) I5 @
    WSGIProcessGroup keystone-public
5 @, B+ r# m, o& N4 r1 N; `    WSGIScriptAlias / /usr/bin/keystone-wsgi-public0 r! v9 {, |! C* T/ U5 o
    WSGIApplicationGroup %{GLOBAL}* ]4 \1 J7 m7 Z
    WSGIPassAuthorization On
! V  J+ a. g& E9 C/ m# l3 Z    LimitRequestBody 114688
$ _3 ]/ Z1 z+ b) i    <IfVersion >= 2.4>. {; m$ k6 S6 M6 m+ u; N
      ErrorLogFormat "%{cu}t %M"' u- H$ I$ E! r1 [) q9 {* k- y+ H2 m
    </IfVersion>
/ H& @5 C9 w) S  C    ErrorLog /var/log/httpd/keystone.log
+ z. l9 `) a% |  I* ?    SetEnvIf User-Agent "(internal dummy connection)" dontlog
6 {# i; Z2 ^3 i    CustomLog /var/log/httpd/keystone_access.log combined env=!dontlog1 u7 u* O# @& R3 s+ H/ t

1 Z$ F6 T! J; O: D3 ^. s& J    <Directory /usr/bin>+ f" L( ?7 A4 y( a& t8 R  d
        <IfVersion >= 2.4>5 {% v2 [7 s4 u  L
            Require all granted' q/ i' S# w+ v( R3 D, d* V; T
        </IfVersion>. t" s4 ]0 k, ^( k! d
        <IfVersion < 2.4>
3 j& |% {: h% r0 O: d0 I& \3 Q. n: N            Order allow,deny
- I* M# u& a; Y* @$ q            Allow from all
1 r7 o4 `5 _, Q6 t5 i* K8 z2 m        </IfVersion>" K0 u2 V! k, X: r8 S6 T6 Z
    </Directory>8 i- b) W* r. p3 G) a
</VirtualHost>' }# N  D* S3 l0 p8 f8 P$ Q
8 E1 n2 `+ E( L; e1 k! h- x& b
<VirtualHost *:35357># {9 f2 N' C5 ], E4 I% z3 M' v
    WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}4 ^$ k/ u' T, t9 k- L
    WSGIProcessGroup keystone-admin( j, n0 {; L( q9 f7 D1 D$ u
    WSGIScriptAlias / /usr/bin/keystone-wsgi-admin; i! W+ h. a; k
    WSGIApplicationGroup %{GLOBAL}6 m, w7 [% H$ f! j; Y! b
    WSGIPassAuthorization On1 S4 P4 x( A  Y' h8 g9 W
    LimitRequestBody 114688, c$ s6 w$ }% O
    <IfVersion >= 2.4>' Y6 `$ d1 V1 N8 `5 K0 A& ]
      ErrorLogFormat "%{cu}t %M"
8 o: n$ u$ _; b8 ~; F# u    </IfVersion>: w( Q( C* f; x, [+ [" X- |
    ErrorLog /var/log/httpd/keystone.log
4 _& ~8 H1 j9 ?. p     SetEnvIf User-Agent "(internal dummy connection)" dontlog* V& P4 l% v5 ~: |1 f
    CustomLog /var/log/httpd/keystone_access.log combined env=!dontlog
8 ~& l9 ~* |! V, e' X3 W2 ~
8 A* `# I. r+ G# N    <Directory /usr/bin>
2 G, L( t' ]/ {9 i% J* h- H        <IfVersion >= 2.4>' H. X1 N9 W5 d" L
            Require all granted
4 U: g0 u  V, D( m8 \" x        </IfVersion>, N* y" w: Y1 s" g5 I. P
        <IfVersion < 2.4>. X: D" t. g; {
            Order allow,deny( e  ~. L; y- U$ b3 r# X; E- |1 U
            Allow from all) S3 w; \/ ~$ f; Y
        </IfVersion>/ s  N6 V2 ]+ k: ?1 K
    </Directory>
5 x# Q7 ~* J; z0 Y</VirtualHost>
) W& V7 S' D2 \; r+ ^5 k) s* B, O3 q! o& ?! i
( f, ^  `! I! s- T, v6 VAlias /identity /usr/bin/keystone-wsgi-public
! J: H4 x. [# ^; W* L6 _<Location /identity>& n0 F; Q% {" g6 E3 h
    SetHandler wsgi-script
+ i' f, e) r7 g: Z/ A* N5 S    Options +ExecCGI5 Z  [8 f6 @0 m* _& ~
" g6 @7 D- o7 ~4 F8 R
    WSGIProcessGroup keystone-public+ C2 Q% j! K6 \) K: K; ]
    WSGIApplicationGroup %{GLOBAL}
- A( T* `) J, i8 f+ [& ^7 o    WSGIPassAuthorization On7 m+ X# z" H3 ^! I! D8 @# p
</Location>
; [# `7 S1 l: G6 M
* ~& d- I' Q/ t  m: s- z5 a" p; JAlias /identity_admin /usr/bin/keystone-wsgi-admin
# Y! R: ?5 ]( a/ c<Location /identity_admin>* c9 z! E7 j3 h; F4 ^2 o9 N: }
    SetHandler wsgi-script& `0 }/ j; k& A+ x2 S; R
    Options +ExecCGI5 [% w5 A/ M/ v8 b: p0 M

9 E* E0 G) \& r3 J  O/ M( _    WSGIProcessGroup keystone-admin
  @6 p1 h/ D- K+ C% M    WSGIApplicationGroup %{GLOBAL}
% h, K; F9 f8 D% W2 ^7 R3 P    WSGIPassAuthorization On, F  n  d  A+ u, Z+ J3 ]) G  P
</Location>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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