閮嚗雿輻私hp-fpm銝餉桃舐箔嚗臭誑冽Linux撣唾(靘憒kevin)餃Apache嚗憒甇乙pache甈蝑(equivalant)嶔evin甈嚗憒甇嚗蝬脩寧桅(靘憒 /home/kevin/),芾kevin甈嚗apache靘踵
p: O& c+ z5 r* M2 g, U9 H6 p. W4 d9 _4 `芷嚗
/ g: V: [0 V, ~& q嗉園蝞∠瑚誑銝頨怠瑁apache(銝芣apache)嚗嫣噶蝬脤蝛粹祉宏 嚗蝬脤蝬撣詨箇整甈銝頞喋憿
- d/ F/ h% \% V3 P. n摰鋆嚗; t" a$ Z7 i4 [
1Apache撌脣鋆
3 k& s8 o/ ?2 ~5 W2摰鋆mod_fastcgi + M$ ~! P: b1 z/ k! _
- cd /usr/tmp% a4 I: b3 N4 b. g5 H
- wget [url]http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz[/url]
% E& J( V* B8 H, v - tar -zxvf mod_fastcgi-current.tar.gz; a J# G9 Z. ?/ b) a
- cd mod_fastcgi-2.4.6
3 h* J* q5 f- @! r/ ? - cp Makefile.AP2 Makefile
% l5 h; Q4 x0 O: e. ?8 w- I - make top_dir=/usr/lib64/httpd #銝餅64bit E" c1 v9 D4 `( N. R
- make install
銴鋆賭誨蝣 嗅瑁 make top_dir=/usr/lib64/httpd 箇暸航炊 : No rule to make target '/usr/lib64/httpd/build/special.mk' 嚗舐撩撠憟隞libtoolhttpd-develapr-develapr嚗潭
# }$ D z; @+ R" H/ c% g- yum install libtool httpd-devel apr apr-devel
銴鋆賭誨蝣 瑁銝甈0 F' _/ q" [- h' |. V) W
- make top_dir=/usr/lib64/httpd
' J( m" U1 B1 a2 X - make install
銴鋆賭誨蝣 亙鋆 , 閰脫 /usr/lib64/httpd/modules/ 銝閬 mod_fastcgi.so
+ a. e+ ?. O" e: e( }3摰鋆php-fpm: F3 h+ J' [4 u+ l4 C
php-fpm , 湔亦 remi(http://www.pigo.idv.tw/archives/242) 摰鋆 , 靘憒 yum -enablerepo=remi install php-fpm
3 o! l: b% Q/ t3 n, w3 G" d 啣閮剖嚗
9 J4 ?, d, z }4 l- F$ n1Apache寧滴orker璅∪(頛雿)嚗靽格/etc/sysconfig/httpd, r) x2 _7 _4 s/ a8 q
- <font size="3">#HTTPD=/usr/sbin/httpd.worker 撠閮餉圾#踵</font>
銴鋆賭誨蝣 2婢pache頛叮od_fastcgi.so+ G6 k8 @: i( S X F! _: I6 S, z2 I' B
/etc/httpd/conf.d/銝啣銝瑼mod_fastcgi.conf嚗批捆嚗
+ O# p6 q% D! |. N% ]- LoadModule fastcgi_module modules/mod_fastcgi.so
銴鋆賭誨蝣 3/etc/httpd/conf.d/php.conf 銝摰閬思誑銝畾(亦∟芾憓)+ T! @! e, I) T+ Z4 z: ]
- <IfModule prefork.c>1 N$ U* J& N! S* d n7 i
- #寞銝 PID 璅∪蝯虫銝 PHP 雿璅∠
$ j0 u T: Y* Q# P - LoadModule php5_module modules/libphp5.so
3 J0 e h$ q; v. A - </IfModule>0 N8 Q6 q7 t- C5 |3 t
- <IfModule worker.c>
4 O- j& \- n2 n - LoadModule php5_module modules/libphp5-zts.so4 t( S9 O$ x4 y* ^9 e0 d8 T
- </IfModule>* v- f3 }& T: D& w( Z
- AddHandler php5-script .php #隞亙舀銝摰閬 .php 蝯撠橘# `" p( p( b1 ^
銴鋆賭誨蝣 4閮剖php-fpm9 t/ r2 W0 |/ H$ u
vi /etc/php-fpm.d/www.conf- ;listen = 127.0.0.1:9000
0 o1 ]. S: E- {( x8 V - listen = /var/run/php-fpm.sock; V7 N, ^" S* j9 \) c+ X/ C
- ; php-fpm 甇撣詨芸Yphp-fpm.sock
: C7 q4 }, \2 E3 ?
銴鋆賭誨蝣 銝虫啣kevin.conf(畚opy www.conf)嚗銝虫耨寞:
# ?& H- f# u0 F* F% l- listen = /var/run/php-fpm_av4u.sock# I% j, Y4 L5 N3 C
- user = kevin, x# b8 v' \7 F
- group = kevin
銴鋆賭誨蝣 php-fpm service php-fpm start
3 G$ f& ]; }; G% z- nhttpd service httpd reload
. h# |% r+ F, @1 Q L/ f; ~蝯嚗% a: `; e7 ~# O3 y
蝬皜祈岫潛曇銋銝璅嚗隞嗆甈銝頞單敶(kevinchmod 755)嚗航隞芣嚗瘙箏Apache寞nginx(瘥頛摰寞)嚗閰.................
* ~% [. e( e K6 i: Y |
|