52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩 ) I$ @9 r8 R- }# @# Q% D

+ ^' ~9 F+ R) X- lCentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮., o; j% ^; C4 [' b+ I" _$ ^
曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.
- w- g/ U1 x' T/ ?' t/ d潭臭敺亙酒erver銴鋆賡靘,摰.
9 ^5 O+ x" O/ g! I" [/ |# B
. K! f5 B0 A) [" O1 p# l  `& [
; E$ ]: w' Q, `% N
/ r$ Z9 ]# o( W8 r
隞乩隤芣亥蝞∠logrotate雿:
# b$ G! a8 c8 y! F& |  o, \- p1 O9 {, P. X" G+ A
- T, B$ y$ d" a1 s# ]
摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx 7 a7 W5 ^2 G: N  x
/var/log/nginx/*.log { * ^- M) [1 L) G/ V9 l+ W
        daily 5 u# w' W' u$ k1 |  t
        missingok ; C+ n2 V( ~1 T1 ~; b  h
        rotate 52
, L$ Z% q/ d" ~" |        compress
5 B& p9 T: Z  X3 h& u% m        delaycompress , ~8 |( C3 N: q8 }- c1 P
        notifempty - G1 w0 _+ E( U% `( S, @
        create 640 nginx adm ( A6 i+ ^+ Q) F& N$ k
        sharedscripts
+ n/ b' Q. \- k8 N8 Q        postrotate
7 ]  l  |7 A. h$ U* g& u" S                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
5 H9 e2 r- u, D* w+ W        endscript
4 ?. `' i: V; n; N}
: I9 z) j! `- rLinux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥.   p& S: e$ Q: s5 t9 ?0 F

; j* g% c9 S/ s" o8 B% b. q
0 |7 \) Q! r5 I4 e' \+ {% w
蝵株牧:
3 y+ W  U# ]* ~! q+ m# ^daily:亥隞嗆憭拚脰皛曉
3 Q: l& T9 |; u- p1 `2 tmissingok:憒曆圈log瑼獢,撠勗蕭仿 & j- T+ w' D  o" P# C
rotate:靽餈52甈⊥遝亥 " i: x, H9 h4 w. u( N$ _
compress:gzip憯蝮株脖誑敺亥
% t" }# V9 G& Q" Zdelaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮 ! n/ A+ w# I/ y6 g
notifempty憒舐征隞嗥閰,銝頧
% L+ T+ v. F/ hcreate mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞
+ W4 O1 I/ k- f' esharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞) $ ]4 ~" n: ?$ c- ~: @  G* w$ ?  N& G
postrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵 9 A2 _4 T0 E3 I: y3 P

- W& W0 {8 q- i$ jlogrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙: ; u& U, {( `  Z) S6 L
/etc/cron.daily/logrotate

# B% Q8 ^7 E9 {! r+ R5 ^5 h/ |/ D0 `

* s0 ~7 q4 F0 O7 P" t  m閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗5 B/ l# J$ ]7 c1 w! P
sudo logrotate -vf /etc/logrotate.d/your-conf-file
. F1 f* U  c9 Q% n8 U2 g
! E! Q- b! _4 f, e* V. y4 p0 Y

4 d) D+ c9 K: F0 Y
9 B9 }' F( O3 l; Q) t- \5 I
閮:: f9 J( Y7 l# D! P$ y
:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html- A0 w3 |. E/ y+ \6 `4 p' K4 t  c
( {" p0 t7 ~; x% n7 x# _

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-6 05:40 , Processed in 0.060322 second(s), 17 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵