52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩
. V  A* s% Y; T
# K# j! [: @: u+ P& M8 F. K3 s* sCentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮.
7 R) X' c0 m- r+ }' h' Z曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.! v/ W6 o1 B) O- L* t2 D6 e0 J* X
潭臭敺亙酒erver銴鋆賡靘,摰.
8 {0 u+ b8 E# I  L" Y, C0 L- }/ l; P

. |( R! s' R/ F6 i* \( _; S; U# Z1 G$ V& z9 X7 t* z
隞乩隤芣亥蝞∠logrotate雿:
0 m. o3 k, V0 ]: |! V
8 L0 J7 A; S: A3 w6 i3 |
8 T1 r8 `; G' H; t1 u
摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx 9 _+ v* h' p* C0 F( z! R8 G
/var/log/nginx/*.log {   G( w% {& e- ]( ~5 Y
        daily 6 a3 ], N- S' E. i7 z+ L, A' R* M
        missingok
& A, ]; g: ^2 V* O: b        rotate 52 ( W; t" K- f9 d
        compress / n% R& e; ]7 ^$ |+ _  @
        delaycompress . v3 `' ~& [$ c! k' Y5 \
        notifempty
/ I0 v) a/ B$ v        create 640 nginx adm
8 O' m4 a( s4 Y, r8 ?, a  g        sharedscripts
- ?( [5 ]5 J5 R, M1 t/ O) ?        postrotate % E( {) r, A' {# O) d: ^* T+ D" @
                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
- X- z' S% i1 e        endscript 3 ?4 q! p7 O( f
}
8 x/ J, [% b3 i" V: i& OLinux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥.
  N$ C& J0 ~) l% t5 w, j, f" g! h4 |, X6 k( m

9 @! ]& q# m; P& O/ A蝵株牧: + n9 r. _# ]3 s  [! ~
daily:亥隞嗆憭拚脰皛曉
1 M7 N- w* y. lmissingok:憒曆圈log瑼獢,撠勗蕭仿
: V& ~: D) `) K# y: a' g4 Qrotate:靽餈52甈⊥遝亥
& q. I4 U( U1 i& V7 E6 Y9 Ecompress:gzip憯蝮株脖誑敺亥
0 b% a2 x- H% r5 t3 J& O$ E6 ?delaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮 & U2 y, r) H- F/ @2 m5 f9 q
notifempty憒舐征隞嗥閰,銝頧 " d, Z3 C' i7 r% u9 U
create mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞 0 H7 }& l; j3 Z' S
sharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞) 0 n- p/ p) F& A3 s9 d" E- n* p, S9 t; X
postrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵 . r( D+ ^- z' b9 H3 q

( Y& s0 F* _/ J8 r# Clogrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙: : H7 W, ?3 @% [+ I2 G
/etc/cron.daily/logrotate

3 E& }$ C+ b# W: ]! i

4 D' A, s) v% D# Y2 b閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗" H$ x* |# F8 h* U- G
sudo logrotate -vf /etc/logrotate.d/your-conf-file

! {4 P7 B" I  w- Q  T
  X& l) s8 C0 u- Y& u! V
) q. J7 U( }5 m% v1 R

# V/ y9 h: k6 p4 `: K# z閮:2 k* o$ e( ]# p) {8 V2 [
:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html
* @) F" U' {, @
0 {5 C. Y5 z8 A6 Q

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-10-21 12:42 , Processed in 1.168288 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵