閮嚗雿輻私hp-fpm銝餉桃舐箔嚗臭誑冽Linux撣唾(靘憒kevin)餃Apache嚗憒甇乙pache甈蝑(equivalant)嶔evin甈嚗憒甇嚗蝬脩寧桅(靘憒 /home/kevin/),芾kevin甈嚗apache靘踵
+ F4 H( P7 m+ `& |' O芷嚗
, _ z1 c6 O* T嗉園蝞∠瑚誑銝頨怠瑁apache(銝芣apache)嚗嫣噶蝬脤蝛粹祉宏 嚗蝬脤蝬撣詨箇整甈銝頞喋憿
# g/ h4 Q2 e. i5 }摰鋆嚗
W( {; A, d' d1Apache撌脣鋆% N3 O9 f. M8 G; b# T! u
2摰鋆mod_fastcgi
, F1 K2 Q$ n1 P+ {$ t- m- O& y# ~- cd /usr/tmp! [* ?; [9 B- n( Y8 N
- wget [url]http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz[/url]
4 G% P+ Q1 Q- H5 S, W) u3 k9 l - tar -zxvf mod_fastcgi-current.tar.gz4 U, H" s1 l) e1 A0 u
- cd mod_fastcgi-2.4.6) x4 x* z- J% h) I7 ~2 E
- cp Makefile.AP2 Makefile
+ Z0 ~: `* h' B6 n- @ - make top_dir=/usr/lib64/httpd #銝餅64bit3 P7 t5 g5 y. [% t: i
- make install
銴鋆賭誨蝣 嗅瑁 make top_dir=/usr/lib64/httpd 箇暸航炊 : No rule to make target '/usr/lib64/httpd/build/special.mk' 嚗舐撩撠憟隞libtoolhttpd-develapr-develapr嚗潭& K+ ]) V! ^. F- w$ C" c5 e! }
- yum install libtool httpd-devel apr apr-devel
銴鋆賭誨蝣 瑁銝甈5 ~. B$ o1 D1 ?. |
- make top_dir=/usr/lib64/httpd) L- i# [( s; C7 q6 g
- make install
銴鋆賭誨蝣 亙鋆 , 閰脫 /usr/lib64/httpd/modules/ 銝閬 mod_fastcgi.so9 n; }, `# x% p( h( H; T( l
3摰鋆php-fpm. @+ p) J. U& N+ p s
php-fpm , 湔亦 remi(http://www.pigo.idv.tw/archives/242) 摰鋆 , 靘憒 yum -enablerepo=remi install php-fpm
9 w" A! }; _# [ 啣閮剖嚗
8 l& h4 y9 P+ K+ B8 A! f1Apache寧滴orker璅∪(頛雿)嚗靽格/etc/sysconfig/httpd! x- E1 h# c' d+ A* d O9 ]
- <font size="3">#HTTPD=/usr/sbin/httpd.worker 撠閮餉圾#踵</font>
銴鋆賭誨蝣 2婢pache頛叮od_fastcgi.so9 G) @. L9 l9 F% Q W
/etc/httpd/conf.d/銝啣銝瑼mod_fastcgi.conf嚗批捆嚗
5 ?, _2 |% [! }- LoadModule fastcgi_module modules/mod_fastcgi.so
銴鋆賭誨蝣 3/etc/httpd/conf.d/php.conf 銝摰閬思誑銝畾(亦∟芾憓)1 s' T9 K) _7 n* x: ~
- <IfModule prefork.c>
' j2 v. p1 C+ F) \ - #寞銝 PID 璅∪蝯虫銝 PHP 雿璅∠# v3 S; h: m$ Q- \
- LoadModule php5_module modules/libphp5.so" E; _) S) i1 b, ?$ j
- </IfModule>
6 l6 _1 Y; Z8 _+ a - <IfModule worker.c>
8 K% O( F6 ^" l7 F, ]; o - LoadModule php5_module modules/libphp5-zts.so
& d1 y1 r h9 E3 R* z8 l8 A, b+ B9 l - </IfModule>2 |+ ]& M3 j) z2 {' ~- s
- AddHandler php5-script .php #隞亙舀銝摰閬 .php 蝯撠橘* v; E/ Q% `+ y& k6 a
銴鋆賭誨蝣 4閮剖php-fpm
. D3 w: ]5 z7 q% v/ jvi /etc/php-fpm.d/www.conf- ;listen = 127.0.0.1:9000( u& \, _: h$ o
- listen = /var/run/php-fpm.sock( c3 n. }3 Z5 X, t' i
- ; php-fpm 甇撣詨芸Yphp-fpm.sock: t. }% }9 ]- H0 V
銴鋆賭誨蝣 銝虫啣kevin.conf(畚opy www.conf)嚗銝虫耨寞:5 m# L( y. E% M) d
- listen = /var/run/php-fpm_av4u.sock
. d* ~ L& G9 @' X1 e) O# X - user = kevin
9 n( r+ ? A$ E2 U0 ]" f9 k - group = kevin
銴鋆賭誨蝣 php-fpm service php-fpm start, e: P1 Z$ \& d' @ {
httpd service httpd reload# [9 J0 J1 l& w$ \* X
蝯嚗
, R4 S: M" g8 [蝬皜祈岫潛曇銋銝璅嚗隞嗆甈銝頞單敶(kevinchmod 755)嚗航隞芣嚗瘙箏Apache寞nginx(瘥頛摰寞)嚗閰.................
; T6 Q7 q& F7 ^- T, C7 Z: b |
|