52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩 # r+ E2 R9 U" K* ]3 ]0 s

- a& X7 H- ?$ R7 QCentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮., j2 S8 Y* c& m/ u9 y9 N- l, h
曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.& b8 D4 W; O; z/ y; i+ |" \' e
潭臭敺亙酒erver銴鋆賡靘,摰.: T3 W2 j7 u) T$ U$ [6 o% Z: f

/ V* l; c+ C0 X! ~1 W/ ~

: i1 v$ T, _* k. ?( J) s
% r9 V# y& E9 \' g0 z" Y
隞乩隤芣亥蝞∠logrotate雿:
0 Y5 t, @4 s: l8 c) I. L9 N; k8 [4 ]. D
, G; O) I% _. D" F+ D7 V: B
摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx
" B* ?+ @: o& w* a3 S  B7 K$ Y/var/log/nginx/*.log {
6 m5 p+ f, d/ y+ O. z        daily 4 k# r7 g2 j; {: J; A. |
        missingok & P' |! S5 @0 K+ R  b8 m" v
        rotate 52 : i5 x7 `  U5 W! E2 p
        compress
% S. D$ L& y7 E& N' U        delaycompress % ^+ P: m- G8 p) r8 D6 B( L- P: U
        notifempty
* V: V% v- J/ h; V2 A        create 640 nginx adm 0 ]# _2 z% g. p
        sharedscripts
6 `3 S, G: M, h9 R        postrotate 6 Z2 d6 ]% Z+ @
                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` " B" k- f# N/ p8 y+ {! v8 i* D3 p) y
        endscript
4 v0 P1 c" O2 [8 n- I8 x) k! O} . }; \  o8 ]$ }
Linux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥. 3 D! ?+ k  G3 @7 s1 `
: V5 ~* @  s+ Q% ^# r/ x
9 E2 i  E5 K6 E, F9 f
蝵株牧: " ^2 A% f7 n7 R+ g3 Y9 F
daily:亥隞嗆憭拚脰皛曉 1 d5 b7 D9 B8 G9 S
missingok:憒曆圈log瑼獢,撠勗蕭仿
, K, V  O' j$ {3 w  _- R2 }rotate:靽餈52甈⊥遝亥 7 B  ^8 [" n/ w( T! V
compress:gzip憯蝮株脖誑敺亥 7 S+ b5 V7 o; m. p' ?1 o6 m* x
delaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮 ) p+ n. o4 U' {% Y, [
notifempty憒舐征隞嗥閰,銝頧 3 m+ d, P& ^8 ]
create mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞
0 s2 z; Q! G5 F) s. E/ C; |sharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞)
$ i0 W4 i% P$ T6 S* ypostrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵 7 v, [6 W- ?( h' K

+ u, ]0 I% ~* W! ~0 N2 {9 mlogrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙:
* ~8 ^% P" F" O% w% ]/ K" Q7 N; H/etc/cron.daily/logrotate
- D, u6 L2 v& d

! A% k6 r. w- R! b2 w: P! B閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗
7 K8 T* }9 g5 ?9 P# Y5 Dsudo logrotate -vf /etc/logrotate.d/your-conf-file
# e6 t7 M% x5 `  ^1 P# c1 v7 [

- U) l4 Z: p- ?; G1 ?  b3 ]
- R' A- v$ c, c

$ d, T$ {- ^& y! B閮:
" t! p3 V( C' f( A: w% n) X4 e:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html
5 [; O; q9 S# O; w. q5 D" L" a* a7 S8 [4 I+ b" ]. `4 v4 k: Z7 e

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-29 21:51 , Processed in 0.075409 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵