52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩
9 Q7 t, o  _/ J* _
; ]9 U2 l# {( k  e5 V" a; s6 gCentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮.& O$ w. s( N6 S; r1 D% u& m/ N
曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.
) s  ]) i& _+ _+ o潭臭敺亙酒erver銴鋆賡靘,摰.
( |- s0 L( R2 M. v# z3 ?( y0 a
: P: S, s$ i; Z" w7 {
/ _  o; C. j4 r5 y. x, x8 {

3 W5 x' n; b6 p1 ?# A4 A# s4 U7 g
隞乩隤芣亥蝞∠logrotate雿:
5 S* x( J  I; a
. _9 K9 D. D2 c0 `" L+ d* O, D

0 r5 `3 ^. ?. D摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx
, ?. i$ u; |3 N* ?6 y: O9 F/var/log/nginx/*.log { * V% A% k' Y6 a+ q- W
        daily 3 q7 X0 P: n. ?* P4 Z. o, u9 U
        missingok
& `& ~6 @! m0 l% x        rotate 52 0 z' I+ a# |' D/ k$ \1 y# I/ M
        compress 2 z  a/ w) c: u
        delaycompress
" ?3 y* Y) B% l6 O        notifempty ( \6 S+ P: p$ q4 H
        create 640 nginx adm 7 D1 w: L. }) A# Q$ N2 x% D' R
        sharedscripts 7 b7 W1 o- z  _2 L0 i8 @
        postrotate 5 C& [9 ~6 |; A; Y  v2 d
                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` : ^- [( R$ `* b3 h* ]
        endscript
  _, ]  d/ F% T# c}
- h' O; q/ y; M5 ^9 w9 l6 VLinux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥. + X/ w( u7 f& S. o

1 }; S8 k2 y7 |4 M2 T" o4 q

% @+ S! B/ K: w+ Q; n蝵株牧: ( ?5 q1 I( M) ~! d3 L+ M# b
daily:亥隞嗆憭拚脰皛曉 4 g: M9 H( m8 a
missingok:憒曆圈log瑼獢,撠勗蕭仿
0 y( w: s7 _+ Z( Z+ I1 B& J0 ~3 Grotate:靽餈52甈⊥遝亥 8 O! q" D& a1 m2 J: o
compress:gzip憯蝮株脖誑敺亥 ; r* x- E3 B+ C2 m
delaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮 8 ^; G0 y5 j& h( ?5 B* l4 C1 A5 r
notifempty憒舐征隞嗥閰,銝頧 " h  {) o5 ?  Y
create mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞 % F. N; [- `$ n3 ], q
sharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞)
4 L/ e- s' T) a  X$ ?1 m/ X# jpostrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵 8 o. g: X- ]) w1 N% A* N
+ ]% ^7 F' ?4 T) p: ]0 g
logrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙:
" e, |* `! D8 |% a2 h, B' J# x: p* q9 e/etc/cron.daily/logrotate

6 L2 ?5 G7 x5 E) p, _! }
6 h- T& a8 Q7 c0 _0 W9 S
閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗; W$ q9 Y& L  P! F0 Q# H
sudo logrotate -vf /etc/logrotate.d/your-conf-file

" y8 N, Z9 J8 [6 c# \
( _) [  J+ f7 R! l+ ^5 }; `

6 b) @& a( Q/ y4 J$ y

& B1 j+ M- c/ x, R* F. O/ K閮:
9 ~/ \2 _6 s9 a! a5 m0 Q$ r, z:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html7 ~* a: P) m2 p, v7 a! e% C6 a
. i5 K& @: [3 L3 Q8 Q2 w4 Q

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-1 18:37 , Processed in 0.057245 second(s), 17 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵