52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩 5 q& @; Z& S) l" z
, I  E/ U1 D- M# V
CentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮.
1 e* G+ M) P/ s9 {! \1 [9 i& M& c8 G曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.3 @" L  s1 y" U# p6 \$ a
潭臭敺亙酒erver銴鋆賡靘,摰.; D, z% k+ {$ J3 s5 X( T$ d- V
! h1 h- N) I# i+ a3 t
$ i* C  Q# y. e/ Q: ?% \
$ L0 A3 F1 I2 b' }
隞乩隤芣亥蝞∠logrotate雿:
" q1 |7 S! i% p5 \# M2 b0 }- w: q1 j+ l. ^( Q

  F: ?8 a4 p( v" q3 O3 t/ i摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx
0 e7 `; E% j9 d# ]5 \) b/var/log/nginx/*.log { / h2 k2 }' O. r) j% L$ C' h) R
        daily 7 R: C  Q3 q! n. N
        missingok
& s$ O& ?$ a4 E7 `" D        rotate 52 # i+ O% s  w( ^" I! l9 N
        compress
% @6 Q; H1 I4 G1 T8 J4 m# C        delaycompress ' t: s% r2 y; L! T
        notifempty ! k$ E- S$ e3 a. L0 R$ S5 z
        create 640 nginx adm
8 @; x6 }+ |0 H& u        sharedscripts 1 l- b1 g+ l0 {" @
        postrotate % C$ _2 l$ E6 a" d2 g* A
                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
" d; m' ]+ j8 ]* `9 E        endscript
* y# I6 Z9 `- N% I( @} / X2 {6 D5 y1 ?* n( M1 @% U, I
Linux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥.
5 ]; ]! v# m. u8 Z; c1 ?3 c/ M  T" k
& o1 B: h4 }# @7 E

3 v1 q% ]* ]- I1 d6 l, }# t蝵株牧:
% Y8 H% s$ U9 ^! l" g( b* ]+ Zdaily:亥隞嗆憭拚脰皛曉 : n. K; F4 C' G5 B
missingok:憒曆圈log瑼獢,撠勗蕭仿 & h: `% s3 L  L
rotate:靽餈52甈⊥遝亥 ' S" b- Q' X- j2 |
compress:gzip憯蝮株脖誑敺亥 0 S- V! u& ~6 v2 z, ~: k
delaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮 # Z6 s8 V4 H5 G  k; `$ ^
notifempty憒舐征隞嗥閰,銝頧 : ^! j. V9 t- ?1 ]6 S
create mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞 & m2 m2 D0 J% q; p) x# E) h
sharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞)
; Y0 L1 k( g( C  y/ m0 N$ K' u, fpostrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵 , X: d# R3 i8 y5 L5 j

' o# R/ i# f( j" ?' O/ Rlogrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙:
. D; m3 f! ]8 r4 s0 n/etc/cron.daily/logrotate

: \$ G* q6 B7 t) C" ^, t) E
6 d! F. t& m) v" [
閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗
9 d1 ~2 e3 x/ R# D' p# ~# ~. Zsudo logrotate -vf /etc/logrotate.d/your-conf-file
" C6 }- I" H* v( O* J; A

/ I0 X4 s  V: f1 V: u
* \" t3 V8 z! ^$ @% ~7 ?1 }% D

) j& [" I8 S9 f閮:9 Z; r6 [& v( q% o2 q* ^% f% t' }$ |
:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html5 V" y& e3 ^" r

+ g& F2 X. Y6 h2 T4 x( z! `

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-27 06:51 , Processed in 0.067559 second(s), 19 queries .

蝯∠.撱

[email protected] | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵