52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4700|敺: 0
銝銝銝駁 銝銝銝駁

[nginx|php-fpm] nginxlog瑼瘝鋡怨芸憯蝮桀隞

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩
- `/ f, V9 L2 L( W
6 R: O- j) }; \; S, LCentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮.3 |# m5 @3 X/ U' x, o! v5 ]
曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.7 R! X- i3 [( R' Y; @$ ?
潭臭敺亙酒erver銴鋆賡靘,摰./ a3 h9 l, b" }, ?2 H
6 g: b* p, i6 D( M3 G

: ^9 R, k5 _7 k
/ {3 s+ p) \9 m+ T. p* K2 J
隞乩隤芣亥蝞∠logrotate雿:7 X, L. R$ u8 D3 }( ^
$ x# ]# d/ N( U0 M2 h

/ o5 q8 ^' K5 W- V摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx - \; o6 k4 Z9 l9 L$ b; s- q5 Z& J
/var/log/nginx/*.log { : g4 r& l7 |/ x+ [+ P2 u! I( d1 T
        daily * C( @' Q$ {5 M1 Z7 v. O
        missingok
- ?6 R- m1 f. r7 x. ]% k        rotate 52
0 }5 |- h5 |% e6 H        compress
9 K* _+ e3 n/ O8 F2 h! Z2 Y# J9 f2 l$ U        delaycompress + r) X& z( s2 x/ S9 K; m8 ]
        notifempty
; H# t% Z6 [& P* \# A7 \        create 640 nginx adm
0 v( }* }  d& O8 ]. Y. x. _        sharedscripts   c' g& c, E; a! [/ z7 T3 ?
        postrotate & X+ |. ^* U( ~7 j2 L$ F- w8 j$ d! l
                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` 4 [- p1 Q9 L4 ?. h+ |
        endscript
+ V9 x* a( f6 g( o  |} ) t1 ^* r5 @1 O, P4 n4 }' z- Z
Linux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥. + ~/ j+ A% w7 R0 _# x, C- I5 `
/ P4 P( \% _5 U* N0 E4 Q

. y" ~8 ~( H, @, e- ~- X& C& z蝵株牧:
8 h( C. R; M' Z$ ]1 X  [* f# Rdaily:亥隞嗆憭拚脰皛曉
6 I3 l3 H! y$ k1 B7 jmissingok:憒曆圈log瑼獢,撠勗蕭仿
+ p. e/ w7 _: Y/ m: `. frotate:靽餈52甈⊥遝亥
0 X0 k) Z6 R, g6 h' u+ |& Zcompress:gzip憯蝮株脖誑敺亥
8 C  c& M! b! }0 ~/ d. hdelaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮 : E7 \3 \* h7 [7 R; x& y6 q) H4 i
notifempty憒舐征隞嗥閰,銝頧
  e# R. ?1 e9 O/ Z4 screate mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞
" V8 C& o( H/ C% O! O  l8 |% O; ]sharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞)
6 |( \- o- C. M4 D6 t  Kpostrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵
( Y) q1 C+ _& ^$ x$ k
+ @' G! g3 c, B- M6 Jlogrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙:
4 [0 [; M0 [3 h( O- Y/etc/cron.daily/logrotate
% ~: S4 M9 u% x5 [

$ h0 @% J2 e+ \, ^4 e閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗. h& q6 \" n8 i9 O$ v; i& x0 G, @  l
sudo logrotate -vf /etc/logrotate.d/your-conf-file

# i( a; s& ^  M; E3 _

, E6 P6 [: w0 `5 J
4 d! a5 O3 T! h: F% P; I8 |6 Y: r+ H- D: ~
" V* ~' s# n& D+ R0 t
閮:1 F9 }8 y0 ^: W7 k, P) p" l
:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html
! P' P8 s  }- X* U
- O& ?$ {" b6 I& o7 \& U1 x

雿輻券

祉蝛閬

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-29 15:29 , Processed in 0.076492 second(s), 19 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵