52AV手機A片王|52AV.ONE

標題: Nginx + PHP-Fpm [打印本頁]

作者: IT_man    時間: 2015-1-11 00:18
標題: Nginx + PHP-Fpm
《1》安裝nginx
7 U8 P* N5 t+ @( y6 I# s7 e2 v yum install nginx  r. D8 ?' U1 r  w, {% J
..........4 K  i( F" U+ Y; O; V! v& E
Running Transaction
( i, i! b5 x3 Q  `$ ]: D7 R  Installing : GeoIP-1.5.1-5.el6.x86_64                                               1/3+ d! K. b, d" n9 Y! i# ^1 N* Y7 X
  Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/3: q7 K. f6 z, U& C5 }1 t& P5 h
  Installing : nginx-1.0.15-11.el6.x86_64                                             3/3
0 x  Y* S6 E- Y- j) q* s& q3 T  Verifying  : nginx-filesystem-1.0.15-11.el6.noarch                                  1/3
% T$ r$ l6 B/ j; S) @4 X" l& y  Verifying  : nginx-1.0.15-11.el6.x86_64                                             2/3" s9 E. L& N/ }1 W% R
  Verifying  : GeoIP-1.5.1-5.el6.x86_64                                               3/3
/ J* Q8 m; @" a  @1 t
$ x- O  d# m! s9 Z2 ?Installed:
$ \& P; G5 K, ]* T6 M  nginx.x86_64 0:1.0.15-11.el6% x' D. a7 r$ Q2 |
Dependency Installed:9 f/ i0 ?! c. F
  GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el6
. F8 {% H% D3 ~Complete!/ E" e1 V8 @. F# I- s
( c# Q  a& W/ P6 X2 s
設定/etc/nginx/nginx.conf

4 j+ }* o2 t7 [3 H+ u( f  A, n
" e' o) b* d" r1 t  t5 B# t6 u; e
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html, K. s: q3 f- d4 s) E2 N0 i# F. v
設定 /etc/php-fpm.d/www.conf  user and group  = nginx (default  apache)  ==> still error
9 I1 H6 l$ K4 i8 I+ f- x1 E5 z; o" }
啟動php-fpm service php-fpm start( ?& ]4 p% |3 ^
啟動nginx      
service nginx start4 _; X. H; C- o
結果& I; ?* n. [8 A, l8 y; Z, S
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
/ [8 Q: a8 @% t& {/ b5 L
解決& A$ ]2 P  m1 J& I' V9 t# i% X1 K4 s
先找libgd.so.2 在何處(locate libgd.so.2*)
結果在/usr/lib64/libgd.backup所以cp /usr/lib64/libgd.backup/libgd.so.2*  /usr/lib64
! q" \# m; ?: L6 D  o8 _, Q1 G再一次啟動nginx
service nginx start8 B4 U9 g6 [) L9 b, |
結果nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
0 L, P3 h1 N! s9 }8 P先查看nginx 的configure /usr/sbin/nginx -V* x+ d. H/ h- R$ a5 ~/ N
nginx version: nginx/1.0.155 N" I6 v7 B% @; u8 {6 i" g6 u
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
+ J3 v1 Q5 S# y' q- w1 v0 CTLS SNI support enabled

+ B1 J& {$ p3 `) Z+ Cconfigure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E& G$ M/ a' K4 r- x4 l
( c4 Q: U+ r. M
( \! L; k' T# ~- `
啟動nginx       service nginx start   
: R  q2 h9 ~* b2 q' v! y9 z) _error : , I2 c& `5 f, s6 g% E/ O/ J
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:408 P) {8 Q1 i7 d& v0 P, z  h
nginx: configuration file /etc/nginx/nginx.conf test failed
$ a% t4 i* @6 h" j( v5 k解決
將/etc/sysconfig/selinux 內的 enforced  設成 disabled    then   reboot    就可以了% L3 `. u. p( Z0 [
SELINUX =  enforcing    改成   disabled
( n. X- ?5 z1 m; f* s& S2 q

! `# P  R8 H- `& q, }) v1 |

2 B  l9 S! G2 w0 y
: g" y( E* l% l! K3 Y4 N3 [! Z7 U2 M! b, E1 t! h: Y7 ]





歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av.one/) Powered by Discuz! X3.2